I am using SceneManager and WidgetCandy where I will have the scene transition when the user clicks a button.
I'm getting some odd behavior where if a user clicks on a button very quickly after a scene has transitioned in then the transition to the next scene fails.
Here is an example of a button that triggers such a scene transition. The existing widgets will be removed, but the scene transition to the "select" scene never occurs. If the user waits a couple of seconds after this "login" scene has been transitioned into and then clicks this button then the "select" scene transitions in correctly.
I suspect that what is happening is that the current scene has not completed the transition in and this is causing an issue, but I'm not sure what is the proper way to handle this.
_G.GUI.NewButton(
{
name = "LoginButton",
x = "auto",
y = "auto",
width = "100%",
parentGroup = "LoginWindow",
theme = "theme_1",
caption = "Login",
textAlign = "center",
--icon = 15,
onRelease = function()
print("We are here")
_G.GUI.RemoveAllWidgets()
sceneManager:changeScene("select", conf.transitionTime, conf.transition, conf.easing)
end,
}
) |
Comments
Scenemanager has some scene transition events:
enterBegin: Dispatched when your new scene is about to enter the stage. You can initialize your variables here.
enterEnd: Dispatched after the transition of new scene has ended. Mostly, you add listeners and start your logic here.
exitBegin: Dispatched when your current scene is about to leave the stage. You can remove listeners and stop timers here.
exitEnd: Dispatched after your current scene has leaved the stage.
http://appcodingeasy.com/Gideros-Mobile/Manage-Scenes-in-Gideros-Mobile
So I can suggest to add UI element on enterEnd, when transition of current scene have ended, so user would be able to click the button only then
Likes: antix
Likes: antix
Near the top of the code you would add a new variable to signify if all widgets are locked or unlocked
Likes: antix