Trait cafe::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)

Implementors§