[][src]Trait amethyst::State

pub trait State<T, E: Send + Sync + 'static> {
    fn on_start(&mut self, _data: StateData<T>) { ... }
fn on_stop(&mut self, _data: StateData<T>) { ... }
fn on_pause(&mut self, _data: StateData<T>) { ... }
fn on_resume(&mut self, _data: StateData<T>) { ... }
fn handle_event(&mut self, _data: StateData<T>, _event: E) -> Trans<T, E> { ... }
fn fixed_update(&mut self, _data: StateData<T>) -> Trans<T, E> { ... }
fn update(&mut self, _data: StateData<T>) -> Trans<T, E> { ... }
fn shadow_fixed_update(&mut self, _data: StateData<T>) { ... }
fn shadow_update(&mut self, _data: StateData<T>) { ... } }

A trait which defines game states that can be used by the state machine.

Provided methods

fn on_start(&mut self, _data: StateData<T>)

Executed when the game state begins.

fn on_stop(&mut self, _data: StateData<T>)

Executed when the game state exits.

fn on_pause(&mut self, _data: StateData<T>)

Executed when a different game state is pushed onto the stack.

fn on_resume(&mut self, _data: StateData<T>)

Executed when the application returns to this game state once again.

fn handle_event(&mut self, _data: StateData<T>, _event: E) -> Trans<T, E>

Executed on every frame before updating, for use in reacting to events.

fn fixed_update(&mut self, _data: StateData<T>) -> Trans<T, E>

Executed repeatedly at stable, predictable intervals (1/60th of a second by default), if this is the active state.

fn update(&mut self, _data: StateData<T>) -> Trans<T, E>

Executed on every frame immediately, as fast as the engine will allow (taking into account the frame rate limit), if this is the active state.

fn shadow_fixed_update(&mut self, _data: StateData<T>)

Executed repeatedly at stable, predictable intervals (1/60th of a second by default), even when this is not the active state, as long as this state is on the StateMachine's state-stack.

fn shadow_update(&mut self, _data: StateData<T>)

Executed on every frame immediately, as fast as the engine will allow (taking into account the frame rate limit), even when this is not the active state, as long as this state is on the StateMachine's state-stack.

Loading content...

Implementors

impl<T: EmptyState> State<(), StateEvent> for T[src]

fn on_start(&mut self, data: StateData<()>)[src]

Executed when the game state begins.

fn on_stop(&mut self, data: StateData<()>)[src]

Executed when the game state exits.

fn on_pause(&mut self, data: StateData<()>)[src]

Executed when a different game state is pushed onto the stack.

fn on_resume(&mut self, data: StateData<()>)[src]

Executed when the application returns to this game state once again.

fn handle_event(&mut self, data: StateData<()>, event: StateEvent) -> EmptyTrans[src]

Executed on every frame before updating, for use in reacting to events.

fn fixed_update(&mut self, data: StateData<()>) -> EmptyTrans[src]

Executed repeatedly at stable, predictable intervals (1/60th of a second by default).

fn update(&mut self, data: StateData<()>) -> EmptyTrans[src]

Executed on every frame immediately, as fast as the engine will allow (taking into account the frame rate limit).

fn shadow_fixed_update(&mut self, data: StateData<()>)[src]

Executed repeatedly at stable, predictable intervals (1/60th of a second by default), even when this is not the active state, as long as this state is on the StateMachine's state-stack.

fn shadow_update(&mut self, data: StateData<()>)[src]

Executed on every frame immediately, as fast as the engine will allow (taking into account the frame rate limit), even when this is not the active state, as long as this state is on the StateMachine's state-stack.

impl<T: SimpleState> State<GameData<'static, 'static>, StateEvent> for T[src]

fn on_start(&mut self, data: StateData<GameData>)[src]

Executed when the game state begins.

fn on_stop(&mut self, data: StateData<GameData>)[src]

Executed when the game state exits.

fn on_pause(&mut self, data: StateData<GameData>)[src]

Executed when a different game state is pushed onto the stack.

fn on_resume(&mut self, data: StateData<GameData>)[src]

Executed when the application returns to this game state once again.

fn handle_event(
    &mut self,
    data: StateData<GameData>,
    event: StateEvent
) -> SimpleTrans
[src]

Executed on every frame before updating, for use in reacting to events.

fn fixed_update(&mut self, data: StateData<GameData>) -> SimpleTrans[src]

Executed repeatedly at stable, predictable intervals (1/60th of a second by default).

fn update(&mut self, data: StateData<GameData>) -> SimpleTrans[src]

Executed on every frame immediately, as fast as the engine will allow (taking into account the frame rate limit).

fn shadow_fixed_update(&mut self, data: StateData<GameData>)[src]

Executed repeatedly at stable, predictable intervals (1/60th of a second by default), even when this is not the active state, as long as this state is on the StateMachine's state-stack.

fn shadow_update(&mut self, data: StateData<GameData>)[src]

Executed on every frame immediately, as fast as the engine will allow (taking into account the frame rate limit), even when this is not the active state, as long as this state is on the StateMachine's state-stack.

Loading content...