Nox Engine
 
Loading...
Searching...
No Matches
MouseTracker Struct Reference

A component attached to an entity that follows the mouse cursor. More...

#include <MouseTracker.h>

Inheritance diagram for MouseTracker:
Inheritance graph
Collaboration diagram for MouseTracker:
Collaboration graph

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
Entityentity
 Pointer to the entity that owns this component.
 

Detailed Description

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.

Member Function Documentation

◆ getMouseButtonPressed()

const bool MouseTracker::getMouseButtonPressed ( )
static

Gets the current state of the primary mouse button.

Returns
True if the mouse button is pressed, false otherwise.
Here is the caller graph for this function:

◆ init()

void MouseTracker::init ( )
overridevirtual

Initializes the component by getting the entity's transform and collider.

Reimplemented from Component.

Here is the call graph for this function:

◆ reload()

void MouseTracker::reload ( )
overridevirtual

Resets the mouse pressed state.

Reimplemented from Component.

◆ update()

void MouseTracker::update ( )
overridevirtual

Updates the entity's position to match the mouse cursor's current coordinates.

Reimplemented from Component.


The documentation for this struct was generated from the following files: