Hi,
I think I've found a bug in the SceneManager: during a changeScene transition to a screen that contains a button (for example see the Game template), if you press it before the transition ends then the button will go out of the scene.
I suppose have to be with the dispatching of the events for the SceneManager when the transition hasn't ended yet.
Please, let me know your apreciated comments.
Many thanks,
David.
Comments
There are four type of events:
I've tried to fix the issue but it's not solved yet. I described the problem incorrectly because it don't have to be with transition listeners but with button listeners.
You can reproduce it with the @ar2rsawseen game template, for example:
· create a menu (i.e. a VerticalView)
· create a button (with the Button class)
· apply a randomize setPosition&setRotation to the button
· add a EventListener to the button for "click" event
· add the button to the menu
· apply setPosition to the menu (->the button will have new setPosition too)
When you have this sequence in your code for a scene and the user "clicks" the button when is "flying" (going from the randomize position to the menu position) the button will go far away or will exit the scene instead of obeying the "click" listener's function.
Please, let me know if you can reproduced the issue.
Many thanks,
David.
https://play.google.com/store/apps/developer?id=SimplesApps
http://www.amazon.com/gp/mas/dl/android?p=com.simplesapps.actionbasket
https://itunes.apple.com/artist/david-rodriguez/id763996989
You call reverse method of View class inside Button click handler, right?
So while the tween is not finished, reverse method invokes another tween on them and thus it gets tweened somewhere where it should not be.
Will need to figure out how to correctly implement tweening inside View class, thank you for report this
Likes: hakan
And it is because of the scenario, where button is pushed, before scene transition ended.
Thus View:reverse is called returning buttons to original randomized positions, and although sceneManager:changeScene is also called, it is yet ignored, because transition did not end yet.
If you move everything into enterEnd event it works as expected. I've commited modified version, you can check it in start scene in start.lua
Other fixes would be: delay of calling new transition for amount of duration of transition (so it would 100% called when transition ended)
Or modifying Scene manager to stack transition calls and execute them later
Or not calling View:reverse, that way at least button would still be on same place and clickable
Likes: SimplesApps
I've checked the changes you have done in start.lua, the view and the popup classes (btw, you removed the Popup:replaceChild method).
As you proposed I moved everything into enterEnd in the start scene and now the bug is fixed but does not work as I would like because the buttons appear after the scene. I prefer that the buttons and the scene appear together.
Therefore I'll think and test other fixes like you propose.
If you have other suggestions please let me know.
Many thanks and Merry Christmas. =D>
https://play.google.com/store/apps/developer?id=SimplesApps
http://www.amazon.com/gp/mas/dl/android?p=com.simplesapps.actionbasket
https://itunes.apple.com/artist/david-rodriguez/id763996989
Likes: SimplesApps
Thanks @ar2rsawseen!
David.
https://play.google.com/store/apps/developer?id=SimplesApps
http://www.amazon.com/gp/mas/dl/android?p=com.simplesapps.actionbasket
https://itunes.apple.com/artist/david-rodriguez/id763996989
https://deluxepixel.com
I found that my tab bar buttons changed straight away if I clicked buttons in quick succession, but the scenes just couldn't keep up because of the scene manager tween delay. This resulted in the wrong button being illuminated for the displayed scene.
Problem worked around by removing button listeners prior to calling scenemanager, then reloading them after a delay.
e.g. for a 1 second transition in scenemanager, a 1100ms delay before re-adding the button event listeners works fine. In other words, I am disarming the buttons while the scene transition is occurring. No problemo.