Trait pixels_graphics_lib::scenes::Scene
source · pub trait Scene<SR: Clone + PartialEq + Debug, SN: Clone + PartialEq + Debug> {
// Required methods
fn render(&self, graphics: &mut Graphics<'_>, mouse_xy: Coord);
fn on_key_press(
&mut self,
key: VirtualKeyCode,
held_keys: &Vec<&VirtualKeyCode>
);
fn on_mouse_click(&mut self, xy: Coord, held_keys: &Vec<&VirtualKeyCode>);
fn update(
&mut self,
timing: &Timing,
mouse_xy: Coord,
held_keys: &Vec<&VirtualKeyCode>
) -> SceneUpdateResult<SR, SN>;
fn resuming(&mut self, result: Option<SR>);
// Provided methods
fn on_scroll(&mut self, xy: Coord, y_diff: isize, x_diff: isize) { ... }
fn is_dialog(&self) -> bool { ... }
}
Required Methods§
sourcefn render(&self, graphics: &mut Graphics<'_>, mouse_xy: Coord)
fn render(&self, graphics: &mut Graphics<'_>, mouse_xy: Coord)
mouse_xy will be -1,-1 if this screen is in the background