Struct ggez_goodies::scene::SceneStack
[−]
[src]
pub struct SceneStack<C, Ev> { pub world: C, // some fields omitted }
A stack of Scene
's, together with a context object.
Fields
world: C
Methods
impl<C, Ev> SceneStack<C, Ev>
[src]
pub fn new(ctx: &mut Context, global_state: C) -> Self
[src]
pub fn push(&mut self, scene: Box<Scene<C, Ev>>)
[src]
Add a new scene to the top of the stack.
pub fn pop(&mut self) -> Box<Scene<C, Ev>>
[src]
Remove the top scene from the stack and returns it; panics if there is none.
pub fn current(&self) -> &Scene<C, Ev>
[src]
Returns the current scene; panics if there is none.
pub fn switch(
&mut self,
next_scene: SceneSwitch<C, Ev>
) -> Option<Box<Scene<C, Ev>>>
[src]
&mut self,
next_scene: SceneSwitch<C, Ev>
) -> Option<Box<Scene<C, Ev>>>
Executes the given SceneSwitch command; if it is a pop or replace
it returns Some(old_scene)
, otherwise None
pub fn update(&mut self)
[src]
pub fn draw(&mut self, ctx: &mut Context)
[src]
Draw the current scene.
pub fn input(&mut self, event: Ev, started: bool)
[src]
Feeds the given input event to the current scene.