A component attached to an entity that follows the mouse cursor. More...
#include <MouseTracker.h>
Public Member Functions | |
| void | init () override |
| Initializes the component by getting the entity's transform and collider. | |
| void | update () override |
| Updates the entity's position to match the mouse cursor's current coordinates. | |
| void | reload () override |
| Resets the mouse pressed state. | |
Public Member Functions inherited from Component | |
| virtual void | draw () |
| Called once per frame after update. Used for rendering. | |
Static Public Member Functions | |
| static const bool | getMouseButtonPressed () |
| Gets the current state of the primary mouse button. | |
Additional Inherited Members | |
Public Attributes inherited from Component | |
| Entity * | entity |
| Pointer to the entity that owns this component. | |
A component attached to an entity that follows the mouse cursor.
This is typically used for a single, global "mouse" entity that can interact with UI elements like buttons.
Gets the current state of the primary mouse button.
|
overridevirtual |
Initializes the component by getting the entity's transform and collider.
Reimplemented from Component.
|
overridevirtual |
Resets the mouse pressed state.
Reimplemented from Component.
|
overridevirtual |
Updates the entity's position to match the mouse cursor's current coordinates.
Reimplemented from Component.