Bug In Getcurrentscenename In Overlay Scene?

Hi.

I noticed that when I run getCurrentSceneName() in a overlayScene, the result is not the overlayScene name, but the name of the scene that called the overlay.

For me this is wrong but before submitting it as a bug I would like to hear some opinions on that. Is this really a bug or am I missing something?

Thanks

Renato

File a bug report please.

File a bug report please.

Was this ever looked into? I’ve just found the same thing happens, which is annoying as I’m setting up the android back key to close overlays or change scenes, but don’t want to have to manually set up a variable to say that an overlay is open. I would’ve expected an open overlay to become the current scene.

Edit: On a related note, do the overlayBegan and overlayEnded events still get dispatched? I  just tried them out and it appears that they don’t. EnterScene and ExitScene do get dispatched, and they are basically the same thing, but overlayBegan and overlayEnded are still shown in the docs.

I remember reading that getCurrentSceneName() should not apply to overlays. Can’t find source though, take it with a grain of salt. But based on that I did my workaround.

I’m not having any problems with overlayBegan and overlayEnded (build 1234).

overlayEnded and overlayBegan are dispatched to the calling storyboard scene.  The overlay scene only gets enterScene/exitScene’s (well createScene, destory too).

What I do for my back button handler is set a flag in my overlay’s enterScene:

storyboard.isOverlay = true

then in exitScene: 

storyboard.isOverlay = false

That way in my back button handler in my main.lua, if I see storyboard.isOverlay is true, I hide it, if not then I go where I think I should go.  I can’t tell from the thread if a bug ever got filed or not.  We need bug reports to fix things like this.  When we ask for a bug report, it’s because we’ve looked at your problem and think its a bug, not an issue with your code and we need the bug report to get it into the engineer’s work queue. 

(Case 21974) getCurrentSceneName() not working properly in Overlay Scene

Submitted on 22 March 2013

Thanks Renato. 

Was this ever looked into? I’ve just found the same thing happens, which is annoying as I’m setting up the android back key to close overlays or change scenes, but don’t want to have to manually set up a variable to say that an overlay is open. I would’ve expected an open overlay to become the current scene.

Edit: On a related note, do the overlayBegan and overlayEnded events still get dispatched? I  just tried them out and it appears that they don’t. EnterScene and ExitScene do get dispatched, and they are basically the same thing, but overlayBegan and overlayEnded are still shown in the docs.

I remember reading that getCurrentSceneName() should not apply to overlays. Can’t find source though, take it with a grain of salt. But based on that I did my workaround.

I’m not having any problems with overlayBegan and overlayEnded (build 1234).

overlayEnded and overlayBegan are dispatched to the calling storyboard scene.  The overlay scene only gets enterScene/exitScene’s (well createScene, destory too).

What I do for my back button handler is set a flag in my overlay’s enterScene:

storyboard.isOverlay = true

then in exitScene: 

storyboard.isOverlay = false

That way in my back button handler in my main.lua, if I see storyboard.isOverlay is true, I hide it, if not then I go where I think I should go.  I can’t tell from the thread if a bug ever got filed or not.  We need bug reports to fix things like this.  When we ask for a bug report, it’s because we’ve looked at your problem and think its a bug, not an issue with your code and we need the bug report to get it into the engineer’s work queue. 

(Case 21974) getCurrentSceneName() not working properly in Overlay Scene

Submitted on 22 March 2013

Thanks Renato.