Struct rust_raylib::drawing::DrawHandle
source · pub struct DrawHandle<'a>(/* private fields */);
Expand description
An object that handles drawing
Implementations§
source§impl<'a> DrawHandle<'a>
impl<'a> DrawHandle<'a>
sourcepub fn end_drawing(self)
pub fn end_drawing(self)
End canvas drawing and swap buffers (double buffering)
Methods from Deref<Target = Raylib>§
sourcepub fn window_should_close(&self) -> bool
pub fn window_should_close(&self) -> bool
Check if Escape key or Close icon is pressed
sourcepub fn is_window_fullscreen(&self) -> bool
pub fn is_window_fullscreen(&self) -> bool
Check if window is currently fullscreen
Check if window is currently hidden (only PLATFORM_DESKTOP)
sourcepub fn is_window_minimized(&self) -> bool
pub fn is_window_minimized(&self) -> bool
Check if window is currently minimized (only PLATFORM_DESKTOP)
sourcepub fn is_window_maximized(&self) -> bool
pub fn is_window_maximized(&self) -> bool
Check if window is currently maximized (only PLATFORM_DESKTOP)
sourcepub fn is_window_focused(&self) -> bool
pub fn is_window_focused(&self) -> bool
Check if window is currently focused (only PLATFORM_DESKTOP)
sourcepub fn is_window_resized(&self) -> bool
pub fn is_window_resized(&self) -> bool
Check if window has been resized last frame
sourcepub fn is_window_state(&self, flag: ConfigFlags) -> bool
pub fn is_window_state(&self, flag: ConfigFlags) -> bool
Check if one specific window flag is enabled
sourcepub fn get_window_handle(&self) -> *mut c_void
pub fn get_window_handle(&self) -> *mut c_void
Get native window handle
sourcepub fn get_screen_width(&self) -> u32
pub fn get_screen_width(&self) -> u32
Get current screen width
sourcepub fn get_screen_height(&self) -> u32
pub fn get_screen_height(&self) -> u32
Get current screen height
sourcepub fn get_render_width(&self) -> u32
pub fn get_render_width(&self) -> u32
Get current render width (it considers HiDPI)
sourcepub fn get_render_height(&self) -> u32
pub fn get_render_height(&self) -> u32
Get current render height (it considers HiDPI)
sourcepub fn get_monitor_count(&self) -> u32
pub fn get_monitor_count(&self) -> u32
Get number of connected monitors
sourcepub fn get_current_monitor(&self) -> u32
pub fn get_current_monitor(&self) -> u32
Get current connected monitor
sourcepub fn get_monitor_position(&self, monitor: u32) -> Vector2
pub fn get_monitor_position(&self, monitor: u32) -> Vector2
Get specified monitor position
sourcepub fn get_monitor_width(&self, monitor: u32) -> u32
pub fn get_monitor_width(&self, monitor: u32) -> u32
Get specified monitor width (current video mode used by monitor)
sourcepub fn get_monitor_height(&self, monitor: u32) -> u32
pub fn get_monitor_height(&self, monitor: u32) -> u32
Get specified monitor height (current video mode used by monitor)
sourcepub fn get_monitor_physical_width(&self, monitor: u32) -> u32
pub fn get_monitor_physical_width(&self, monitor: u32) -> u32
Get specified monitor physical width in millimetres
sourcepub fn get_monitor_physical_height(&self, monitor: u32) -> u32
pub fn get_monitor_physical_height(&self, monitor: u32) -> u32
Get specified monitor physical height in millimetres
sourcepub fn get_monitor_refresh_rate(&self, monitor: u32) -> u32
pub fn get_monitor_refresh_rate(&self, monitor: u32) -> u32
Get specified monitor refresh rate
sourcepub fn get_window_position(&self) -> Vector2
pub fn get_window_position(&self) -> Vector2
Get window position XY on monitor
sourcepub fn get_window_scale_dpi(&self) -> Vector2
pub fn get_window_scale_dpi(&self) -> Vector2
Get window scale DPI factor
sourcepub fn get_monitor_name(&self, monitor: u32) -> String
pub fn get_monitor_name(&self, monitor: u32) -> String
Get the human-readable, UTF-8 encoded name of the primary monitor
sourcepub fn get_clipboard_text(&self) -> String
pub fn get_clipboard_text(&self) -> String
Get clipboard text content
Check if cursor is not visible
sourcepub fn is_cursor_on_screen(&self) -> bool
pub fn is_cursor_on_screen(&self) -> bool
Check if cursor is on the screen
sourcepub fn get_frame_time(&self) -> Duration
pub fn get_frame_time(&self) -> Duration
Get time for last frame drawn (delta time)
sourcepub fn get_random_value(&self, min: i32, max: i32) -> i32
pub fn get_random_value(&self, min: i32, max: i32) -> i32
Get a random value between min and max (both included)
sourcepub fn is_file_dropped(&self) -> bool
pub fn is_file_dropped(&self) -> bool
Check if a file has been dropped into window
sourcepub fn get_dropped_files(&self) -> Vec<String>
pub fn get_dropped_files(&self) -> Vec<String>
Load dropped filepaths
sourcepub fn is_key_pressed(&self, key: KeyboardKey) -> bool
pub fn is_key_pressed(&self, key: KeyboardKey) -> bool
Check if a key has been pressed once
sourcepub fn is_key_down(&self, key: KeyboardKey) -> bool
pub fn is_key_down(&self, key: KeyboardKey) -> bool
Check if a key is being pressed
sourcepub fn is_key_released(&self, key: KeyboardKey) -> bool
pub fn is_key_released(&self, key: KeyboardKey) -> bool
Check if a key has been released once
sourcepub fn is_key_up(&self, key: KeyboardKey) -> bool
pub fn is_key_up(&self, key: KeyboardKey) -> bool
Check if a key is NOT being pressed
sourcepub fn get_key_pressed(&self) -> KeyboardKey
pub fn get_key_pressed(&self) -> KeyboardKey
Get key pressed (keycode), call it multiple times for keys queued, returns KeyboardKey::Null
when the queue is empty
sourcepub fn get_char_pressed(&self) -> Option<char>
pub fn get_char_pressed(&self) -> Option<char>
Get char pressed (unicode), call it multiple times for chars queued, returns None
when the queue is empty
sourcepub fn is_gamepad_available(&self, gamepad: u32) -> bool
pub fn is_gamepad_available(&self, gamepad: u32) -> bool
Check if a gamepad is available
sourcepub fn get_gamepad_name(&self, gamepad: u32) -> String
pub fn get_gamepad_name(&self, gamepad: u32) -> String
Get gamepad internal name id
Check if a gamepad button has been pressed once
Check if a gamepad button is being pressed
Check if a gamepad button has been released once
Check if a gamepad button is NOT being pressed
Get the last gamepad button pressed
sourcepub fn get_gamepad_axis_count(&self, gamepad: u32) -> u32
pub fn get_gamepad_axis_count(&self, gamepad: u32) -> u32
Get gamepad axis count for a gamepad
sourcepub fn get_gamepad_axis_movement(&self, gamepad: u32, axis: GamepadAxis) -> f32
pub fn get_gamepad_axis_movement(&self, gamepad: u32, axis: GamepadAxis) -> f32
Get axis movement value for a gamepad axis
Check if a mouse button has been pressed once
Check if a mouse button is being pressed
Check if a mouse button has been released once
Check if a mouse button is NOT being pressed
sourcepub fn get_mouse_x(&self) -> i32
pub fn get_mouse_x(&self) -> i32
Get mouse position X
sourcepub fn get_mouse_y(&self) -> i32
pub fn get_mouse_y(&self) -> i32
Get mouse position Y
sourcepub fn get_mouse_position(&self) -> Vector2
pub fn get_mouse_position(&self) -> Vector2
Get mouse position XY
sourcepub fn get_mouse_delta(&self) -> Vector2
pub fn get_mouse_delta(&self) -> Vector2
Get mouse delta between frames
sourcepub fn get_mouse_wheel_move(&self) -> f32
pub fn get_mouse_wheel_move(&self) -> f32
Get mouse wheel movement for X or Y, whichever is larger
sourcepub fn get_mouse_wheel_move_vec(&self) -> Vector2
pub fn get_mouse_wheel_move_vec(&self) -> Vector2
Get mouse wheel movement for both X and Y
sourcepub fn get_touch_x(&self) -> i32
pub fn get_touch_x(&self) -> i32
Get touch position X for touch point 0 (relative to screen size)
sourcepub fn get_touch_y(&self) -> i32
pub fn get_touch_y(&self) -> i32
Get touch position Y for touch point 0 (relative to screen size)
sourcepub fn get_touch_position(&self, index: u32) -> Vector2
pub fn get_touch_position(&self, index: u32) -> Vector2
Get touch position XY for a touch point index (relative to screen size)
sourcepub fn get_touch_point_id(&self, index: u32) -> u32
pub fn get_touch_point_id(&self, index: u32) -> u32
Get touch point identifier for given index
sourcepub fn get_touch_point_count(&self) -> u32
pub fn get_touch_point_count(&self) -> u32
Get number of touch points
sourcepub fn is_gesture_detected(&self, gesture: Gesture) -> bool
pub fn is_gesture_detected(&self, gesture: Gesture) -> bool
Check if a gesture have been detected
sourcepub fn get_gesture_detected(&self) -> Gesture
pub fn get_gesture_detected(&self) -> Gesture
Get latest detected gesture
sourcepub fn get_gesture_hold_duration(&self) -> Duration
pub fn get_gesture_hold_duration(&self) -> Duration
Get gesture hold time
sourcepub fn get_gesture_drag_vector(&self) -> Vector2
pub fn get_gesture_drag_vector(&self) -> Vector2
Get gesture drag vector
sourcepub fn get_gesture_drag_angle(&self) -> f32
pub fn get_gesture_drag_angle(&self) -> f32
Get gesture drag angle
sourcepub fn get_gesture_pinch_vector(&self) -> Vector2
pub fn get_gesture_pinch_vector(&self) -> Vector2
Get gesture pinch delta
sourcepub fn get_gesture_pinch_angle(&self) -> f32
pub fn get_gesture_pinch_angle(&self) -> f32
Get gesture pinch angle