Trait Game

Source
pub trait Game {
    type Render: Render;

Show 38 methods // Required method fn new() -> Self; // Provided methods fn create_render() -> Self::Render { ... } fn run(&mut self, _dt: f32, _render: &mut Self::Render) -> bool { ... } fn quit(&self) -> bool { ... } fn window_close(&self) { ... } fn window_resized(&mut self, _width: i32, _height: i32) { ... } fn window_moved(&mut self, _x: i32, _y: i32) { ... } fn window_minimized(&mut self) { ... } fn window_maximized(&mut self) { ... } fn key_down( &mut self, _keycode: Option<Keycode>, _scancode: Option<Scancode>, _repeat: bool, _keymod: Mod, ) { ... } fn key_up( &mut self, _keycode: Option<Keycode>, _scancode: Option<Scancode>, _repeat: bool, _keymod: Mod, ) { ... } fn joystick_added(&mut self, _which: u32) { ... } fn joystick_removed(&mut self, _which: u32) { ... } fn controller_added(&mut self, _which: u32) { ... } fn controller_removed(&mut self, _which: u32) { ... } fn mouse_motion(&mut self, _x: i32, _y: i32, _xrel: i32, _yrel: i32) { ... } fn mouse_wheel(&mut self, _scroll_x: f32, _scroll_y: f32, _flipped: bool) { ... } fn text_editing(&mut self, _text: String, _start: i32, _length: i32) { ... } fn text_input(&mut self, _text: String) { ... } fn joy_button_up(&mut self, _which: u32, _button: u8) { ... } fn joy_button_down(&mut self, _which: u32, _button: u8) { ... } fn joy_hat_motion(&mut self, _which: u32, _hat: u8, _state: HatState) { ... } fn joy_ball_motion( &mut self, _which: u32, _ball: u8, _xrel: i16, _yrel: i16, ) { ... } fn joy_axis_motion(&mut self, _which: u32, _axis: u8, _value: i16) { ... } fn controller_button_up(&mut self, _which: u32, _button: Button) { ... } fn controller_button_down(&mut self, _which: u32, _button: Button) { ... } fn controller_axis_motion(&mut self, _which: u32, _axis: Axis, _value: i16) { ... } fn controller_remapped(&mut self, _which: u32) { ... } fn drop_file(&mut self, _filename: String) { ... } fn drop_text(&mut self, _text: String) { ... } fn drop_begin(&mut self) { ... } fn drop_complete(&mut self) { ... } fn finger_up( &mut self, _touch_id: i64, _finger_id: i64, _x: f32, _y: f32, _dx: f32, _dy: f32, _pressure: f32, ) { ... } fn finger_down( &mut self, _touch_id: i64, _finger_id: i64, _x: f32, _y: f32, _dx: f32, _dy: f32, _pressure: f32, ) { ... } fn finger_motion( &mut self, _touch_id: i64, _finger_id: i64, _x: f32, _y: f32, _dx: f32, _dy: f32, _pressure: f32, ) { ... } fn dollar_record( &mut self, _touch_id: i64, _gesture_id: i64, _num_fingers: u32, _error: f32, _x: f32, _y: f32, ) { ... } fn dollar_gesture( &mut self, _touch_id: i64, _gesture_id: i64, _num_fingers: u32, _error: f32, _x: f32, _y: f32, ) { ... } fn clipboard_update(&mut self) { ... }
}

Required Associated Types§

Required Methods§

Source

fn new() -> Self

Provided Methods§

Source

fn create_render() -> Self::Render

Source

fn run(&mut self, _dt: f32, _render: &mut Self::Render) -> bool

Source

fn quit(&self) -> bool

Source

fn window_close(&self)

Source

fn window_resized(&mut self, _width: i32, _height: i32)

Source

fn window_moved(&mut self, _x: i32, _y: i32)

Source

fn window_minimized(&mut self)

Source

fn window_maximized(&mut self)

Source

fn key_down( &mut self, _keycode: Option<Keycode>, _scancode: Option<Scancode>, _repeat: bool, _keymod: Mod, )

Source

fn key_up( &mut self, _keycode: Option<Keycode>, _scancode: Option<Scancode>, _repeat: bool, _keymod: Mod, )

Source

fn joystick_added(&mut self, _which: u32)

Source

fn joystick_removed(&mut self, _which: u32)

Source

fn controller_added(&mut self, _which: u32)

Source

fn controller_removed(&mut self, _which: u32)

Source

fn mouse_motion(&mut self, _x: i32, _y: i32, _xrel: i32, _yrel: i32)

Source

fn mouse_wheel(&mut self, _scroll_x: f32, _scroll_y: f32, _flipped: bool)

Source

fn text_editing(&mut self, _text: String, _start: i32, _length: i32)

Source

fn text_input(&mut self, _text: String)

Source

fn joy_button_up(&mut self, _which: u32, _button: u8)

Source

fn joy_button_down(&mut self, _which: u32, _button: u8)

Source

fn joy_hat_motion(&mut self, _which: u32, _hat: u8, _state: HatState)

Source

fn joy_ball_motion(&mut self, _which: u32, _ball: u8, _xrel: i16, _yrel: i16)

Source

fn joy_axis_motion(&mut self, _which: u32, _axis: u8, _value: i16)

Source

fn controller_button_up(&mut self, _which: u32, _button: Button)

Source

fn controller_button_down(&mut self, _which: u32, _button: Button)

Source

fn controller_axis_motion(&mut self, _which: u32, _axis: Axis, _value: i16)

Source

fn controller_remapped(&mut self, _which: u32)

Source

fn drop_file(&mut self, _filename: String)

Source

fn drop_text(&mut self, _text: String)

Source

fn drop_begin(&mut self)

Source

fn drop_complete(&mut self)

Source

fn finger_up( &mut self, _touch_id: i64, _finger_id: i64, _x: f32, _y: f32, _dx: f32, _dy: f32, _pressure: f32, )

Source

fn finger_down( &mut self, _touch_id: i64, _finger_id: i64, _x: f32, _y: f32, _dx: f32, _dy: f32, _pressure: f32, )

Source

fn finger_motion( &mut self, _touch_id: i64, _finger_id: i64, _x: f32, _y: f32, _dx: f32, _dy: f32, _pressure: f32, )

Source

fn dollar_record( &mut self, _touch_id: i64, _gesture_id: i64, _num_fingers: u32, _error: f32, _x: f32, _y: f32, )

Source

fn dollar_gesture( &mut self, _touch_id: i64, _gesture_id: i64, _num_fingers: u32, _error: f32, _x: f32, _y: f32, )

Source

fn clipboard_update(&mut self)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§