Type Definition amethyst::prelude::TransEvent[][src]

type TransEvent<T, E> = Box<dyn Fn() -> Trans<T, E> + Send + Sync + 'static>;

Event queue to trigger state Trans from other places than a State's methods.

Example:

world.write_resource::<EventChannel<TransEvent<MyGameData, StateEvent>>>().single_write(Box::new(|| Trans::Quit));

Transitions will be executed sequentially by Amethyst's CoreApplication update loop.