The Table Engine
CrosshairScript Class Reference

Script for managing the crosshair in the game. More...

#include <crosshair_script.h>

+ Inheritance diagram for CrosshairScript:
+ Collaboration diagram for CrosshairScript:

Public Member Functions

void update () override
 Updates the position of the crosshair based on the mouse cursor. More...
 
- Public Member Functions inherited from Script
 Script ()
 Default constructor, initializes an empty script. More...
 
 Script (std::string name)
 Constructs a Script with a specified name. More...
 
virtual ~Script ()
 Virtual destructor to allow for cleanup in derived script classes. More...
 
std::string getName ()
 Retrieves the name of the script. More...
 
GameObjectgetOwner ()
 Retrieves the owner GameObject of this script. More...
 
void setOwner (GameObject *owner)
 Sets the owner of this script. More...
 
virtual void input ()
 Virtual method for handling input. Should be overridden by derived classes. More...
 
virtual void render ()
 Virtual method for rendering operations. Should be overridden by derived classes. More...
 

Additional Inherited Members

- Public Attributes inherited from Script
std::string m_name
 Name of the script, useful for identification or debugging. More...
 
GameObjectm_owner
 Pointer to the GameObject that owns this script. More...
 

Detailed Description

Script for managing the crosshair in the game.

This script updates the position of the crosshair to follow the mouse cursor.

Definition at line 9 of file crosshair_script.h.

Member Function Documentation

◆ update()

void CrosshairScript::update ( )
overridevirtual

Updates the position of the crosshair based on the mouse cursor.

Reimplemented from Script.

Definition at line 6 of file crosshair_script.cpp.


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