logo

Trait primitives::prelude::SceneManager[][src]

pub trait SceneManager {
    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 [Scene] state machine.

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

Required methods

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

Sets the current scene to a new scene.

Arguments
  • kind - The new scene.

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

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

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

Implementors