-
Notifications
You must be signed in to change notification settings - Fork 31
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
Splash screen allows exiting early (with escape key) #257
Conversation
There should be a container, but let-else will prevent a panic. The splash screen will still transition away when all the images are worked through if there is no container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this veers into the territory of "nice to have, but not necessary for most users", I want @alice-i-cecile's opinion on whether we should add this. I'm personally ambivalent.
In any case, consider upstreaming the code as an official example. I think it would be really helpful there :D
I like both of these, but strongly seconding the recommendation to upstream the splash screen code as an official example in the |
This will be moved into an example
OK, I've removed the multi-splash screen code, resolved any discussions relating that and updated the PR description. |
app.add_systems( | ||
Update, | ||
exit_splash_screen | ||
.run_if(input_just_pressed(KeyCode::Escape).and_then(in_state(Screen::Splash))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally think that this reads better when written as two separate run_if
because of the line break, but I'm not blocking on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO that's confusing because you have to know whether that yields an and
or an or
behavior. Would be neat if run conditions could use &&
somehow to improve readability.
This PR allows the player to exit the splash screen at any time by hitting `KeyCode::escape`. --- Previously this PR also contained code for displaying multiple splash screens, but after discussion that will be migrated to an example in the bevy repository. --------- Co-authored-by: Ben Frankel <[email protected]>
This PR allows the player to exit the splash screen at any time by hitting
KeyCode::escape
.Previously this PR also contained code for displaying multiple splash screens, but after discussion that will be migrated to an example in the bevy repository.