-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
state "create" method being called twice when using "In" transition #17
Comments
Good question! First I was pretty sure it's a bug, but it turns out, that it does make sense. Now that you've brought this to light - something that I have clearly missed, I think I should warn the users, whenever they fancy a slide-in animation for that state, that they should be careful about it, since instantiating twice the state, could lead to bad results. Thanks for asking. I really appreciate it! Note: I'm opened to suggestions, so if any, let me know. |
thanks for the response. Just curious, is it not possible to take the snapshot without clearing the state? Or perhaps take a snapshot of the current state first, then instead of 'sliding in' the new one, you create the new state, put the snapshot on top, then slide out the snapshot to reveal the current (new) state underneath? It seems that might avoid the need of initializing the new state twice. |
So this is what's happening right now, without using the sliding in option. Just talking about it, makes me look even more into the issue. I'm pretty sure I'll remove the support for transition in for states, down the road, but we'll see. |
I have the same problem, when I tested my game on samsung galaxy its ok but when I tested it on lenovo it occurs, my question is there any way to get rid of this. sometimes it looks bad. |
Hey! Yup. Do not use a transition for 'in' state. That means, no third parameter to |
Is there going to be some solution for this? I really like the way it looks when combining slides for both out and in. Is it really necessary to clear the state and call create again when the transition completes? |
please take a look this gif gif when I clicked the button its sliding twice. |
@Montoya working on it. @shohan4556 that's not pretty. Check out this example https://jsfiddle.net/cristianbote/xen8usb9/ and maybe there's something you're missing. Reopened and working on a fix. |
I did not call |
There's no relation between |
Thanks for the reply, surely I will give a try at the moment I am busy now. |
#17: Added _created overwrite between transition out and in
Alright, I just did a new push, to fix this behavior. Let me know if there's anything related to it. Cheers! |
Its ok now I just tested it, Thanks. |
When I pass in the optional In transition, the create method is being called twice. Just wondering if this is intended, as it seems like it might be unnecessary.
How I'm calling:
game.state.start('MainMenu', Phaser.Plugin.StateTransition.Out.SlideRight, Phaser.Plugin.StateTransition.In.SlideRight);
The text was updated successfully, but these errors were encountered: