pub trait TheTrait {
Show 33 methods
// Required method
fn new() -> Self
where Self: Sized;
// Provided methods
fn init(&mut self, ctx: &mut TheContext) { ... }
fn default_window_size(&self) -> (usize, usize) { ... }
fn min_window_size(&self) -> (usize, usize) { ... }
fn default_window_position(&self) -> Option<(i32, i32)> { ... }
fn window_title(&self) -> String { ... }
fn target_fps(&self) -> f64 { ... }
fn window_icon(&self) -> Option<(Vec<u8>, u32, u32)> { ... }
fn set_cmd_line_args_early(&mut self, args: Vec<String>) { ... }
fn set_cmd_line_args(&mut self, args: Vec<String>, ctx: &mut TheContext) { ... }
fn draw(&mut self, pixels: &mut [u8], ctx: &mut TheContext) { ... }
fn update(&mut self, ctx: &mut TheContext) -> bool { ... }
fn touch_down(&mut self, x: f32, y: f32, ctx: &mut TheContext) -> bool { ... }
fn touch_dragged(&mut self, x: f32, y: f32, ctx: &mut TheContext) -> bool { ... }
fn touch_up(&mut self, x: f32, y: f32, ctx: &mut TheContext) -> bool { ... }
fn hover(&mut self, _x: f32, _y: f32, ctx: &mut TheContext) -> bool { ... }
fn key_down(
&mut self,
char: Option<char>,
key: Option<TheKeyCode>,
ctx: &mut TheContext,
) -> bool { ... }
fn key_up(
&mut self,
char: Option<char>,
key: Option<TheKeyCode>,
ctx: &mut TheContext,
) -> bool { ... }
fn mouse_wheel(
&mut self,
delta: (isize, isize),
ctx: &mut TheContext,
) -> bool { ... }
fn modifier_changed(
&mut self,
shift: bool,
ctrl: bool,
alt: bool,
logo: bool,
) -> bool { ... }
fn dropped_file(&mut self, _path: String) -> bool { ... }
fn closing(&self) -> bool { ... }
fn open(&mut self) { ... }
fn save(&mut self) { ... }
fn save_as(&mut self) { ... }
fn cut(&mut self) -> String { ... }
fn copy(&mut self) -> String { ... }
fn paste(&mut self, text: String) { ... }
fn undo(&mut self) { ... }
fn redo(&mut self) { ... }
fn has_changes(&self) -> bool { ... }
fn window_moved(&mut self, _x: i32, _y: i32) { ... }
fn window_resized(&mut self, _width: usize, _height: usize) { ... }
}Required Methods§
Provided Methods§
fn init(&mut self, ctx: &mut TheContext)
fn default_window_size(&self) -> (usize, usize)
Sourcefn min_window_size(&self) -> (usize, usize)
fn min_window_size(&self) -> (usize, usize)
Minimum resizable window size.
Defaults to default_window_size() but can be overridden independently.
fn default_window_position(&self) -> Option<(i32, i32)>
fn window_title(&self) -> String
fn target_fps(&self) -> f64
fn window_icon(&self) -> Option<(Vec<u8>, u32, u32)>
fn set_cmd_line_args_early(&mut self, args: Vec<String>)
fn set_cmd_line_args(&mut self, args: Vec<String>, ctx: &mut TheContext)
fn draw(&mut self, pixels: &mut [u8], ctx: &mut TheContext)
fn update(&mut self, ctx: &mut TheContext) -> bool
fn touch_down(&mut self, x: f32, y: f32, ctx: &mut TheContext) -> bool
fn touch_dragged(&mut self, x: f32, y: f32, ctx: &mut TheContext) -> bool
fn touch_up(&mut self, x: f32, y: f32, ctx: &mut TheContext) -> bool
fn hover(&mut self, _x: f32, _y: f32, ctx: &mut TheContext) -> bool
fn key_down( &mut self, char: Option<char>, key: Option<TheKeyCode>, ctx: &mut TheContext, ) -> bool
fn key_up( &mut self, char: Option<char>, key: Option<TheKeyCode>, ctx: &mut TheContext, ) -> bool
fn mouse_wheel(&mut self, delta: (isize, isize), ctx: &mut TheContext) -> bool
fn modifier_changed( &mut self, shift: bool, ctrl: bool, alt: bool, logo: bool, ) -> bool
fn dropped_file(&mut self, _path: String) -> bool
fn closing(&self) -> bool
fn cut(&mut self) -> String
fn copy(&mut self) -> String
fn paste(&mut self, text: String)
fn undo(&mut self)
fn redo(&mut self)
Sourcefn has_changes(&self) -> bool
fn has_changes(&self) -> bool
Returns true if the app has internal changes.