[][src]Trait amethyst::prelude::SimpleState

pub trait SimpleState {
    fn on_start(&mut self, _data: StateData<GameData>) { ... }
fn on_stop(&mut self, _data: StateData<GameData>) { ... }
fn on_pause(&mut self, _data: StateData<GameData>) { ... }
fn on_resume(&mut self, _data: StateData<GameData>) { ... }
fn handle_event(
        &mut self,
        _data: StateData<GameData>,
        event: StateEvent
    ) -> SimpleTrans { ... }
fn fixed_update(&mut self, _data: StateData<GameData>) -> SimpleTrans { ... }
fn update(&mut self, _data: &mut StateData<GameData>) -> SimpleTrans { ... }
fn shadow_fixed_update(&mut self, _data: StateData<GameData>) { ... }
fn shadow_update(&mut self, _data: StateData<GameData>) { ... } }

A simple State trait. It contains GameData as its StateData and no custom StateEvent.

Provided methods

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

Executed when the game state begins.

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

Executed when the game state exits.

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

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

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

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

fn handle_event(
    &mut self,
    _data: StateData<GameData>,
    event: StateEvent
) -> SimpleTrans

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

fn fixed_update(&mut self, _data: StateData<GameData>) -> SimpleTrans

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

fn update(&mut self, _data: &mut StateData<GameData>) -> SimpleTrans

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>)

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>)

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

Loading content...