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);
}
Expand description
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 Drawable
s should do fine.
Required Methods
sourcefn draw(&self, canvas: &mut Canvas<Window>, settings: DrawSettings)
fn draw(&self, canvas: &mut Canvas<Window>, settings: DrawSettings)
Draw the content of this scene to a Canvas
.
sourcefn register(&mut self)
fn register(&mut self)
Register everything. The scene equivalent of Drawable::register
sourcefn load(&mut self)
fn load(&mut self)
Load everything. The scene equivalent of Drawable::load