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