11 if (
input && transform) {
12 int worldMouseX =
input->m_mouseX + cameraPosition.x - 320 - 8;
13 int worldMouseY =
input->m_mouseY + cameraPosition.y - 240 - 8;
14 transform->setWorldPosition(worldMouseX, worldMouseY);
void update() override
Updates the position of the crosshair based on the mouse cursor.
T * getComponent()
Gets a component of the specified type.
static SceneManager & getInstance()
Retrieves the singleton instance of SceneManager.
Vec2 getCameraWorldPosition()
Retrieves the world position of the camera.
virtual void input()
Virtual method for handling input. Should be overridden by derived classes.
GameObject * m_owner
Pointer to the GameObject that owns this script.
Defines the SceneManager class for managing scenes in the game.