Migrating stacked states to bevy 0.10 #8537
Unanswered
chrishulbert
asked this question in
Q&A
Replies: 1 comment
-
So the way i implemented this was to create an 'is transitioning' resource, set to true at the start, and false at the end of the transition. Then I created a 'run condition' system like so:
And finally, in all the screens that used transitions, i added a
This is a lot more code than it was in bevy 0.9, i wonder if there's a better way? I guess it doesn't matter much. And probably worth it to simplify bevy and get rid of the stacked states - they were super complex, i understand the motivation to remove them :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, My code followed an example that used stacked states to create a fade-to-black-then-fade-in transition effect between states: It would push a 'fading' state which would allow the old state to remain visible however it would not receive user input during the fade, and replace the whole stack with the new state after it reached the black in the middle of the transition.
Now that we cannot push states however, i'm not sure how to implement this neatly, any suggestions?
Here's my 0.9 code: https://github.com/chrishulbert/rusty-lemmings/blob/9e34441e2103d2aedb8cad5c4681f075dfe963a3/src/fadeout.rs#L53
Here's my 0.10 version so far: https://github.com/chrishulbert/rusty-lemmings/blob/master/src/fadeout.rs
The problem is that my 0.10 version still allows interaction with the old screen. It'd be nice to disable the old screens without having to update every screen of my app to have a flag whereby it ignores user input after initiating a fade.
Any suggestions hugely appreciated, thanks for the great work :)
Beta Was this translation helpful? Give feedback.
All reactions