Expand description
The app prelude.
This includes the most common types in this crate, re-exported for your convenience.
Structs§
- App
App
is the primary API for writing user applications. It automates the setup of a standard lifecycle and provides interface glue for plugins.- First
- Runs first in the schedule.
- Fixed
First - Runs first in the
FixedMain
schedule. - Fixed
Last - The schedule that runs last in
FixedMain
- Fixed
Post Update - The schedule that runs after the
FixedUpdate
schedule, for reacting to changes made in the main update logic. - Fixed
PreUpdate - The schedule that contains logic that must run before
FixedUpdate
. - Fixed
Update - The schedule that contains most gameplay logic, which runs at a fixed rate rather than every render frame.
For logic that should run once per render frame, use the
Update
schedule instead. - Last
- Runs last in the schedule.
- Main
- The schedule that contains the app logic that is evaluated each tick of
App::update()
. - Post
Startup - The schedule that runs once after
Startup
. - Post
Update - The schedule that contains logic that must run after
Update
. For example, synchronizing “local transforms” in a hierarchy to “global” absolute transforms. This enables thePostUpdate
transform-sync system to react to “local transform” changes inUpdate
without theUpdate
systems needing to know about (or add scheduler dependencies for) the “global transform sync system”. - PreStartup
- The schedule that runs before
Startup
. - PreUpdate
- The schedule that contains logic that must run before
Update
. For example, a system that reads raw keyboard input OS events into anEvents
resource. This enables systems inUpdate
to consume the events from theEvents
resource without actually knowing about (or taking a direct scheduler dependency on) the “os-level keyboard event system”. - RunFixed
Main Loop - Runs the
FixedMain
schedule in a loop according until all relevant elapsed time has been “consumed”. - Spawn
Scene - The schedule that contains scene spawning.
- Startup
- The schedule that runs once when the app starts.
- SubApp
- A secondary application with its own
World
. These can run independently of each other. - Update
- The schedule that contains any app logic that must run once per render frame.
For most gameplay logic, consider using
FixedUpdate
instead.
Enums§
- AppExit
- An event that indicates the
App
should exit. If one or more of these are present at the end of an update, the runner will end and (maybe) return control to the caller. - RunFixed
Main Loop System - Set enum for the systems that want to run inside
RunFixedMainLoop
, but before or after the fixed update logic. Systems in this set will run exactly once per frame, regardless of the number of fixed updates. They will also run under a variable timestep.
Traits§
- Plugin
- A collection of Bevy app logic and configuration.
- Plugin
Group - Combines multiple
Plugin
s into a single unit.