Scene "Pop-up" Functionality is in!

Hi all,

Just wanted to give you a quick update.

The very-much requested “scene pop-up” functionality is now in place, has been pushed in, and will appear in the daily builds soon.

They aren’t called “pop-up” though. They are called “scene overlays”, and you can use any storyboard scene with them.

The documentation pages are up if you want to get a head start before the build gets posted:

storyboard.showOverlay()
storyboard.hideOverlay()

With this and the parameter passing functionality that was added recently, we’ve got almost all requests just about covered (as well as bugs—be sure to submit any you find with a test case!).

Thanks for all your feedback! [import]uid: 52430 topic_id: 25602 reply_id: 325602[/import]

Thanks for the good news @Jonathan.

The pop-ups are welcome!
Cheers,
Rodrigo. [import]uid: 89165 topic_id: 25602 reply_id: 103429[/import]

This is much welcomed indeed.

[import]uid: 19626 topic_id: 25602 reply_id: 103544[/import]

Can I call storyboard.hideOverlay() from a button event inside the storyboard? I am using 100ms delay to call that, but still getting the error:

Runtime error
?:0: attempt to index upvalue ‘?’ (a nil value)
stack traceback:
[C]: ?
?: in function ‘?’
?: in function <?:1158>
(tail call): ?
?: in function <?:1215>
?: in function <?:218>

UPDATED: removed the comment about effect. It works. I have been using old format instead of using options table. [import]uid: 19297 topic_id: 25602 reply_id: 103568[/import]

@ckausic: I really don’t know why storyboard.hideOverlay() is giving you problems when calling it from a button—it should work fine. Is it just a widget button and hideOverlay is called from an onRelease listener (I assume from the overlay scene)?
[import]uid: 52430 topic_id: 25602 reply_id: 103763[/import]

When calling storyboard.hideOverlay("slideRight", 200) from within the overlay scene itself, I’m receiving the same error as ckausic. The error is appearing in the console after the “overlayEnded” event listener in the main storyboard module (not the overlay) is called.

However, as emanouel noted in this thread, if I just call storyboard.hideOverlay() with no transition, there is no error.

Any ideas?

  • David [import]uid: 149111 topic_id: 25602 reply_id: 123820[/import]

When calling storyboard.hideOverlay("slideRight", 200) from within the overlay scene itself, I’m receiving the same error as ckausic. The error is appearing in the console after the “overlayEnded” event listener in the main storyboard module (not the overlay) is called.

However, as emanouel noted in this thread, if I just call storyboard.hideOverlay() with no transition, there is no error.

Any ideas?

  • David [import]uid: 149111 topic_id: 25602 reply_id: 123820[/import]

I finally solved my problem. To trigger the hiding of the overlay, I was checking to see if the user had swiped to the right:

[lua]-- Touch listener to close inventory
function invBackground:touch (e)
if (e.phase == “moved”) then
if (e.x - e.xStart > 150) then
storyboard.hideOverlay(“slideRight”, 200)
end
end
return true
end[/lua]

The problem was that storyboard.hideOverlay would be called multiple times, as there are 200 ms between the first call and the time the overlay is actually hidden. The same could possibly have been happening with @ckausic’s button; I’ve noticed that often when clicking a button in the simulator, it registers as multiple touches. Removing the transition fixed this because after the first touch the overlay is hidden.

To be able to use the transition, I simply had to make sure hideOverlay was only called once:

[lua]-- Touch listener to close inventory
function invBackground:touch (e)
if (e.phase == “moved”) then
if (e.x - e.xStart > 150 and overlayHiding == false) then
storyboard.hideOverlay(“slideRight”, 200)
overlayHiding = true
end
end
return true
end[/lua]

Glad to finally have that one solved!

  • David [import]uid: 149111 topic_id: 25602 reply_id: 125924[/import]

I finally solved my problem. To trigger the hiding of the overlay, I was checking to see if the user had swiped to the right:

[lua]-- Touch listener to close inventory
function invBackground:touch (e)
if (e.phase == “moved”) then
if (e.x - e.xStart > 150) then
storyboard.hideOverlay(“slideRight”, 200)
end
end
return true
end[/lua]

The problem was that storyboard.hideOverlay would be called multiple times, as there are 200 ms between the first call and the time the overlay is actually hidden. The same could possibly have been happening with @ckausic’s button; I’ve noticed that often when clicking a button in the simulator, it registers as multiple touches. Removing the transition fixed this because after the first touch the overlay is hidden.

To be able to use the transition, I simply had to make sure hideOverlay was only called once:

[lua]-- Touch listener to close inventory
function invBackground:touch (e)
if (e.phase == “moved”) then
if (e.x - e.xStart > 150 and overlayHiding == false) then
storyboard.hideOverlay(“slideRight”, 200)
overlayHiding = true
end
end
return true
end[/lua]

Glad to finally have that one solved!

  • David [import]uid: 149111 topic_id: 25602 reply_id: 125924[/import]