swamp_game

Trait Application

Source
pub trait Application: Sized + 'static {
Show 18 methods // Required methods fn new(assets: &mut impl Assets) -> Self; fn tick(&mut self, assets: &mut impl Assets); fn render(&mut self, gfx: &mut impl Gfx); // Provided methods fn audio(&mut self, _audio: &mut impl Audio) { ... } fn wants_to_quit(&self) -> bool { ... } fn wants_cursor_visible(&self) -> bool { ... } fn keyboard_input(&mut self, _state: ButtonState, _key_code: KeyCode) { ... } fn cursor_entered(&mut self) { ... } fn cursor_left(&mut self) { ... } fn cursor_moved(&mut self, _position: UVec2) { ... } fn mouse_input(&mut self, _state: ButtonState, _button: MouseButton) { ... } fn mouse_wheel(&mut self, _delta_y: i16) { ... } fn mouse_motion(&mut self, _delta: Vec2) { ... } fn gamepad_activated(&mut self, _gamepad_id: GamePadId, _name: String) { ... } fn gamepad_button_changed( &mut self, _gamepad: &Gamepad, _button: Button, _value: Fp, ) { ... } fn gamepad_axis_changed( &mut self, _gamepad: &Gamepad, _axis: Axis, _value: Fp, ) { ... } fn gamepad_disconnected(&mut self, _gamepad_id: GamePadId) { ... } fn scale_factor_changed(&mut self, _scale_factor: f64) -> Option<UVec2> { ... }
}

Required Methods§

Source

fn new(assets: &mut impl Assets) -> Self

Source

fn tick(&mut self, assets: &mut impl Assets)

Source

fn render(&mut self, gfx: &mut impl Gfx)

Provided Methods§

Source

fn audio(&mut self, _audio: &mut impl Audio)

Source

fn wants_to_quit(&self) -> bool

Source

fn wants_cursor_visible(&self) -> bool

Source

fn keyboard_input(&mut self, _state: ButtonState, _key_code: KeyCode)

Source

fn cursor_entered(&mut self)

Source

fn cursor_left(&mut self)

Source

fn cursor_moved(&mut self, _position: UVec2)

Source

fn mouse_input(&mut self, _state: ButtonState, _button: MouseButton)

Source

fn mouse_wheel(&mut self, _delta_y: i16)

Source

fn mouse_motion(&mut self, _delta: Vec2)

Source

fn gamepad_activated(&mut self, _gamepad_id: GamePadId, _name: String)

Source

fn gamepad_button_changed( &mut self, _gamepad: &Gamepad, _button: Button, _value: Fp, )

Source

fn gamepad_axis_changed(&mut self, _gamepad: &Gamepad, _axis: Axis, _value: Fp)

Source

fn gamepad_disconnected(&mut self, _gamepad_id: GamePadId)

Source

fn scale_factor_changed(&mut self, _scale_factor: f64) -> Option<UVec2>

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§