Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Overlay Modal not working?
Started by jack95 Jan 17 2016 01:37 AM

12 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

jack95

[GLOBAL: userInfoPane.html]
jack95
  • Contributor

  • 197 posts
  • Corona SDK

Am I the only one who can't get the overlay modal mode to work? All my UI underneath still responds.



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,042 posts
  • Enterprise

Can you post your code where you're calling your overlay and setting it modal? 

 

Thanks

Rob



[TOPIC: post.html]
#3

jack95

[GLOBAL: userInfoPane.html]
jack95
  • Contributor

  • 197 posts
  • Corona SDK

            composer.showOverlay( "scenes.overlays.squadselect", {
                isModal = true,
                params = {
                    callingFrom = "more"
                }
            })

It's in a scene, calling another scene. It works, but all the events come through to the calling scene. Right now I add a screen-covering button before calling the overlay, with a transparent defaultFrame button. "tap" events still come through, so I have a little extra hack code for that.



[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,042 posts
  • Enterprise

Display objects that are not part of the parent scene or part of the overlay scene (i.e. you did not insert them into the scene group) are always on top of composer managed objects.

 

Also touch handlers don't catch tap events. You have to include tap handlers on your objects.  The model overlay scene already puts a transparent full screen rectangle on the overlay's background that intercepts both touch and tap handlers for you.

 

Objects in your parent's scene should not be able to be touched, if they are properly inserted into the parent's scene view group.

 

Rob



[TOPIC: post.html]
#5

jack95

[GLOBAL: userInfoPane.html]
jack95
  • Contributor

  • 197 posts
  • Corona SDK

The model overlay scene already puts a transparent full screen rectangle on the overlay's background that intercepts both touch and tap handlers for you.

 

For the build CoronaSDK 2016.2809, Overlay (modal) does not prevent those intercepted events from being caught by the parent scene.

 

I guess I have to whip up a proof of concept, since it's not already known.



[TOPIC: post.html]
#6

jack95

[GLOBAL: userInfoPane.html]
jack95
  • Contributor

  • 197 posts
  • Corona SDK

Here's the code:

 

http://temp-host.com/download.php?file=zs60vc 

 

Run, click the arrow ( in the middle of the scene ) click around the edges, see touch events go through and even the bottom left arrow buttons can still be clicked. Overlay Modal does not work.



[TOPIC: post.html]
#7

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,042 posts
  • Enterprise

temp-host.com isn't responding. Can  you make it available by dropbox or some other method?

 

Rob



[TOPIC: post.html]
#8

jack95

[GLOBAL: userInfoPane.html]
jack95
  • Contributor

  • 197 posts
  • Corona SDK

[TOPIC: post.html]
#9

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,042 posts
  • Enterprise

Can I get you to go ahead and file a bug report. You can use the zip file you put on dropbox. Use the Report a link option at the top of the page. When you fill out the form, please reference this forum post. Also you will get a confirmation email. That email has a Case ID in the subject. Please post that back here, then I can ping the engineers to look at it.

 

The overlay rectangle is there, it's just shifted down and to the right, like it's centered on the top left corner at the center of the screen. You can click along the right and bottom edges and see where the clicks stop flowing through.

 

Once I have the CaseID I can go to Engineering with the problem.  Sooner is better.

 

Rob



[TOPIC: post.html]
#10

davebollinger

[GLOBAL: userInfoPane.html]
davebollinger
  • Corona Geek

  • 1,357 posts
  • Corona SDK

display.setDefault( "anchorX", 0 )
display.setDefault( "anchorY", 0 )

avoid doing this 'globally'



[TOPIC: post.html]
#11

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,042 posts
  • Enterprise

Good catch @davebollinger.  Still file the bug report. Composer should be hardened against it.

 

Rob



[TOPIC: post.html]
#12

phpedinei

[GLOBAL: userInfoPane.html]
phpedinei
  • Enthusiast

  • 68 posts
  • Corona SDK

effects are having the same problem with

display.setDefault( "anchorX", 0 )
display.setDefault( "anchorY", 0 )


 



[TOPIC: post.html]
#13

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,042 posts
  • Enterprise

As Dave pointed out, you probably should avoid setting the anchor's globally to 0. As far as I know, no one has filed a bug report on this yet.

 

Rob




[topic_controls]
[/topic_controls]