SceneManager

Trait SceneManager 

Source
pub trait SceneManager {
    // Required methods
    fn scene(&self) -> Box<dyn EngineScene>;
    fn set_scene(&self, kind: SceneKind);
    fn back(&self);
    fn next(&self);
    fn restart(&self);
}
Expand description

The SceneManager should be implemented by objects intended to manage the EngineScene state machine.

Only a single scene is active at any given update. Which scene is configured by this manager.

Required Methods§

Source

fn scene(&self) -> Box<dyn EngineScene>

The currently active scene. Use as a runtime property and not as an initialization property.

Source

fn set_scene(&self, kind: SceneKind)

Sets the current scene to a new scene.

§Arguments
  • kind - The new scene.
Source

fn back(&self)

Sets the current scene to the scene returned by Factory::get_back_scene_type(). The new scene should be representative of retreat. @see Factory::get_back_scene_type

Source

fn next(&self)

Sets the current scene to the scene returned by Factory::get_next_Scene_type(). The new scene should be representative of progress. @see Factory::get_next_scene_type

Source

fn restart(&self)

Restarts the current scene. Equivalent of disposing current scene and then setScene to current scene again.

Implementors§