The Table Engine
|
Component for handling and storing the state of input devices. More...
#include <input.h>
Public Member Functions | |
Input () | |
Constructor for the Input component. More... | |
~Input () | |
Destructor for the Input component. More... | |
void | update () override |
Updates the state of the input based on the latest user interactions. More... | |
![]() | |
Component () | |
Default constructor for the Component. More... | |
Component (std::string name) | |
Constructs a Component with a specified name. More... | |
virtual | ~Component () |
Virtual destructor for safe polymorphic use. More... | |
std::string | getName () |
Retrieves the name of the component. More... | |
GameObject * | getOwner () |
Retrieves the GameObject that owns this component. More... | |
void | setName (std::string name) |
Sets the name of the component. More... | |
void | setOwner (GameObject *owner) |
Sets the GameObject owner of this component. More... | |
virtual void | input () |
Virtual method for handling input, intended to be overridden by derived components. More... | |
virtual void | render () |
Virtual method for rendering, intended to be overridden by derived components. More... | |
Public Attributes | |
bool | spacePressed = false |
True if the space bar is pressed, false otherwise. More... | |
bool | leftPressed = false |
True if the left arrow key is pressed, false otherwise. More... | |
bool | rightPressed = false |
True if the right arrow key is pressed, false otherwise. More... | |
bool | upPressed = false |
True if the up arrow key is pressed, false otherwise. More... | |
bool | downPressed = false |
True if the down arrow key is pressed, false otherwise. More... | |
int | m_mouseX |
int | m_mouseY |
Current position of the mouse cursor. More... | |
bool | mouseLeftPressed = false |
True if the left mouse button is pressed, false otherwise. More... | |
bool | mouseRightPressed = false |
True if the right mouse button is pressed, false otherwise. More... | |
bool | mouseMiddlePressed = false |
True if the middle mouse button is pressed, false otherwise. More... | |
Additional Inherited Members | |
![]() | |
std::string | m_name |
Name of the component, useful for identification or debugging. More... | |
GameObject * | m_owner |
Pointer to the GameObject that owns this component. More... | |
Component for handling and storing the state of input devices.
The Input class extends the Component class and is used to track the state of various keys and mouse buttons, as well as the mouse's position, providing a centralized way to handle user interactions.
|
overridevirtual |
bool Input::downPressed = false |
bool Input::leftPressed = false |
bool Input::mouseLeftPressed = false |
bool Input::mouseMiddlePressed = false |
bool Input::mouseRightPressed = false |
bool Input::rightPressed = false |
bool Input::spacePressed = false |
bool Input::upPressed = false |