[][src]Trait ytesrev::scene::Scene

pub trait Scene: Send {
    fn update(&mut self, _dt: f64);
fn draw(&self, canvas: &mut Canvas<Window>, settings: DrawSettings);
fn event(&mut self, _event: YEvent);
fn action(&self) -> Action;
fn register(&mut self);
fn load(&mut self); }

A scene is like a Drawable, but without the modularity, it's in the top level and no wrappers for it exists. Unless you're doing something advanced, a DrawableWrapper around your Drawables should do fine.

Required methods

fn update(&mut self, _dt: f64)

Do a tick

fn draw(&self, canvas: &mut Canvas<Window>, settings: DrawSettings)

Draw the content of this scene to a Canvas.

fn event(&mut self, _event: YEvent)

Called when an event occured

fn action(&self) -> Action

What to do

fn register(&mut self)

Register everything. The scene equivalent of Drawable::register

fn load(&mut self)

Load everything. The scene equivalent of Drawable::load

Loading content...

Implementors

impl Scene for SceneList[src]

impl<T: Drawable> Scene for DrawableWrapper<T>[src]

Loading content...