Struct bottomless_pit::engine_handle::Engine
source · pub struct Engine { /* private fields */ }Expand description
The thing that makes the computer go
Implementations§
source§impl Engine
impl Engine
sourcepub fn create_texture(
&mut self,
path: &str
) -> Result<TextureIndex, TextureError>
pub fn create_texture( &mut self, path: &str ) -> Result<TextureIndex, TextureError>
Attempts to create a texture
sourcepub fn is_key_down(&self, key: Key) -> bool
pub fn is_key_down(&self, key: Key) -> bool
Checks if a key is down
sourcepub fn is_key_pressed(&self, key: Key) -> bool
pub fn is_key_pressed(&self, key: Key) -> bool
Only returns true on the frame where the key is first pressed down
sourcepub fn is_key_released(&self, key: Key) -> bool
pub fn is_key_released(&self, key: Key) -> bool
Only returns true on the frame where the key first returns back up
sourcepub fn is_mouse_key_down(&self, key: MouseKey) -> bool
pub fn is_mouse_key_down(&self, key: MouseKey) -> bool
Checks if a mouse key is down
sourcepub fn is_mouse_key_up(&self, key: MouseKey) -> bool
pub fn is_mouse_key_up(&self, key: MouseKey) -> bool
Checks if a mouse key is up
sourcepub fn is_mouse_key_pressed(&self, key: MouseKey) -> bool
pub fn is_mouse_key_pressed(&self, key: MouseKey) -> bool
Only returns true on the frame where the key is first pressed down
sourcepub fn is_mouse_key_released(&self, key: MouseKey) -> bool
pub fn is_mouse_key_released(&self, key: MouseKey) -> bool
Only returns true on the frame where the key first returns back up
sourcepub fn get_mouse_position(&self) -> Vec2<f32>
pub fn get_mouse_position(&self) -> Vec2<f32>
Gives the current position of the mouse in physical pixels
sourcepub fn window_has_focus(&self) -> bool
pub fn window_has_focus(&self) -> bool
Checks if the window has focus
sourcepub fn is_window_maximized(&self) -> bool
pub fn is_window_maximized(&self) -> bool
Checks if the window is maximized not fullscreened
sourcepub fn is_window_minimized(&self) -> bool
pub fn is_window_minimized(&self) -> bool
Checks to see if the window is minimized
sourcepub fn is_window_fullscreen(&self) -> bool
pub fn is_window_fullscreen(&self) -> bool
Checks to see if the window is fullscreen not maximized
sourcepub fn maximize_window(&self)
pub fn maximize_window(&self)
Will maximize the window
sourcepub fn minimize_window(&self)
pub fn minimize_window(&self)
Will minimize the window
sourcepub fn set_window_icon(&self, path: &str) -> Result<(), IconError>
pub fn set_window_icon(&self, path: &str) -> Result<(), IconError>
Will attempt to set the window icon for more details check the winit docs
sourcepub fn set_window_title(&self, title: &str)
pub fn set_window_title(&self, title: &str)
Sets the window title
sourcepub fn set_window_position(&self, x: f32, y: f32)
pub fn set_window_position(&self, x: f32, y: f32)
Changes the Position of the window in PhysicalPixles
sourcepub fn set_window_min_size(&self, width: f32, height: f32)
pub fn set_window_min_size(&self, width: f32, height: f32)
Sets the physical minimum size of the window
sourcepub fn get_window_position(&self) -> Option<Vec2<i32>>
pub fn get_window_position(&self) -> Option<Vec2<i32>>
Gets the physical postion of the window
sourcepub fn get_window_size(&self) -> Vec2<u32>
pub fn get_window_size(&self) -> Vec2<u32>
Gets the phyisical size of the window,
sourcepub fn get_window_scale_factor(&self) -> f64
pub fn get_window_scale_factor(&self) -> f64
Gets the scale factor to help handle diffrence between phyiscial and logical pixels
sourcepub fn toggle_fullscreen(&self)
pub fn toggle_fullscreen(&self)
Toggels fullscreen mode may fail on certain Operating Systems check the winit docs for more information
sourcepub fn hide_cursor(&mut self)
pub fn hide_cursor(&mut self)
Hides the cursor
sourcepub fn show_cursor(&mut self)
pub fn show_cursor(&mut self)
Shows the cursor if its hidden
sourcepub fn change_camera_matrix(&mut self, matrix: [f32; 16])
pub fn change_camera_matrix(&mut self, matrix: [f32; 16])
Will update the camera matrix as of version 0.1.0 it will effect all things drawn is also 3D