diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-20 11:12:51 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-20 11:12:51 +0100 |
commit | 5c65e3e5662e261311a2a544d00a9eabbf632198 (patch) | |
tree | 9e9a71f6d2ab2e4f9e9ccfe101ad5256f9dde33c /src/crepe/system/InputSystem.h | |
parent | 44741315c6d2df9bd6591c19ea189163e5c70add (diff) | |
parent | 31ffbbbab541760b0574c6e6819a99575c1ce8b1 (diff) |
Merge branch 'wouter/relative_ui' of github.com:lonkaars/crepe
Diffstat (limited to 'src/crepe/system/InputSystem.h')
-rw-r--r-- | src/crepe/system/InputSystem.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/crepe/system/InputSystem.h b/src/crepe/system/InputSystem.h index 0f1bfa1..2cb80e5 100644 --- a/src/crepe/system/InputSystem.h +++ b/src/crepe/system/InputSystem.h @@ -94,20 +94,24 @@ private: * \param mouse_button The mouse button involved in the click. * \param world_mouse_x The X coordinate of the mouse in world space. * \param world_mouse_y The Y coordinate of the mouse in world space. + * \param current_cam The current active camera. * * This method processes the mouse click event and triggers the corresponding button action. */ - void handle_click(const MouseButton & mouse_button, const vec2 & mouse_pos); + void handle_click(const MouseButton & mouse_button, const vec2 & mouse_pos, + const Camera & current_cam); /** * \brief Handles the mouse movement event. * \param event_data The event data containing information about the mouse movement. * \param world_mouse_x The X coordinate of the mouse in world space. * \param world_mouse_y The Y coordinate of the mouse in world space. + * \param current_cam The current active camera. * * This method processes the mouse movement event and updates the button hover state. */ - void handle_move(const EventData & event_data, const vec2 & mouse_pos); + void handle_move(const EventData & event_data, const vec2 & mouse_pos, + const Camera & current_cam); /** * \brief Checks if the mouse position is inside the bounds of the button. @@ -115,10 +119,11 @@ private: * \param world_mouse_y The Y coordinate of the mouse in world space. * \param button The button to check. * \param transform The transform component of the button. + * \param cam_transform the transform of the current active camera * \return True if the mouse is inside the button, false otherwise. */ bool is_mouse_inside_button(const vec2 & mouse_pos, const Button & button, - const Transform & transform); + const Transform & transform, const Transform & cam_transform); /** * \brief Handles the button press event, calling the on_click callback if necessary. |