Trait amethyst_engine::State
[−]
[src]
pub trait State { fn on_start(&mut self) { ... } fn on_stop(&mut self) { ... } fn on_pause(&mut self) { ... } fn on_resume(&mut self) { ... } fn handle_events(&mut self, _events: &[i32]) { ... } fn fixed_update(&mut self, _delta: Duration) -> Trans { ... } fn update(&mut self, _delta: Duration) -> Trans { ... } }
A trait which defines game states that can be used by the state machine.
Provided Methods
fn on_start(&mut self)
Executed when the game state begins.
fn on_stop(&mut self)
Executed when the game state exits.
fn on_pause(&mut self)
Executed when a different game state is pushed onto the stack.
fn on_resume(&mut self)
Executed when the application returns to this game state once again.
fn handle_events(&mut self, _events: &[i32])
Executed on every frame before updating, for use in reacting to events.
fn fixed_update(&mut self, _delta: Duration) -> Trans
Executed repeatedly at stable, predictable intervals (1/60th of a second by default).
fn update(&mut self, _delta: Duration) -> Trans
Executed on every frame immediately, as fast as the engine will allow.