|
| | Mouse () noexcept |
| | Constructor.
|
| | ~Mouse () noexcept |
| | Destructor.
|
| bool | mouse_connected () const noexcept |
| | Check if there is a mouse connected.
|
| void | set_mouse_grab (const bool grabbed) const noexcept |
| | Toggle mouse grab.
|
| void | warp_mouse (const float x, const float y) const noexcept |
| | Move the mouse cursor to the given position within the window.
|
| bool | set_window_mouse_rect (iRect &rect) noexcept |
| | Confines the cursor to the specified area of a window.
|
| void | show_cursor () const noexcept |
| | Show cursor.
|
| void | hide_cursor () const noexcept |
| | Hide cursor.
|
| void | set_cursor_system (const SDL_SystemCursor cursor) noexcept |
| | Set cursor to a system cursor.
|
| void | use_custom_mouse (const std::string &cursor, const glm::ivec2 &offset=glm::ivec2(0, 0)) |
| | Replaces the system cursor with a bitmap.
|
| void | restore_cursor () noexcept |
| | Set the cursor back to default.
|
| bool | is_mouse_down (const MouseButton btn) const noexcept |
| | Check if a mouse button was pressed.
|
| int | mouse_x () const noexcept |
| | Get current cursor x position.
|
| int | mouse_y () const noexcept |
| | Get current cursor y position.
|
| void | set_mouse_mapping (const int x, const int y, const float scale_x, const float scale_y) const noexcept |
| | Set mouse relative mapping to another coord space.
|
| void | clear_mouse_mapping () const noexcept |
| | Return mouse_x()/mouse_y() to plain screen coordinates.
|
| void | set_relative_mouse_mode (const bool enabled) const noexcept |
| | Enable or disable relative mouse mode (locks cursor to window, hides it, and reports relative motion).
|
| bool | relative_mouse_mode () const noexcept |
| | Return whether relative mouse mode is currently enabled.
|
| glm::ivec2 | mouse_delta (int *dx, int *dy) noexcept |
| | Retrieve relative mouse movement (delta) since the last call.
|
| virtual | ~WindowBindable () noexcept |
| | Virtual destructor.
|
Physical mouse device and state management.
Definition at line 28 of file Mouse.hpp.
| void galaxy::Mouse::use_custom_mouse |
( |
const std::string & | cursor, |
|
|
const glm::ivec2 & | offset = glm::ivec2(0, 0) ) |
Replaces the system cursor with a bitmap.
Use a bitmap as the mouse cursor, drawn so the pixel at (offset_x, offset_y), measured from the bitmap's top-left, sits on the mouse position; nullptr restores the OS.
- Parameters
-
| cursor | Texture to draw. |
| offset | Top left, right of mouse cursor. |
Definition at line 86 of file Mouse.cpp.
| void galaxy::Mouse::set_mouse_mapping |
( |
const int | x, |
|
|
const int | y, |
|
|
const float | scale_x, |
|
|
const float | scale_y ) const |
|
noexcept |
Set mouse relative mapping to another coord space.
Make mouse_x()/mouse_y() report positions inside a scaled image drawn at (x, y) in screen coordinates with the given scale, for example a letterboxed or integer-scaled render target. See present_scaled_target(). Positions over the bars fall outside the image's coordinate range.
- Parameters
-
| x | Upper X position of space. |
| y | Upper Y position of space. |
| scale_x | Scale "width". |
| scale_y | Scale "height". |
Definition at line 153 of file Mouse.cpp.