Polygon Dash
Loading...
Searching...
No Matches
ComponentTransformMouseClick Class Reference

Handle a mouse click on a texture-based GameObject. More...

Inheritance diagram for ComponentTransformMouseClick:
ComponentScript IComponent

Public Member Functions

void delegate () mCallbackFunction
 The callback to run when a click event occurs.
 
 this (size_t owner, void delegate() callbackFunction, ComponentTransform transform, SDL_Rect *camera)
 Set up the script.
 
override void Update ()
 Update internal state of the script.
 
void LeftMouseClick ()
 Check for an in-bounds mouse click and run #callback if one was found.
 
- Public Member Functions inherited from ComponentScript
 this (size_t id)
 Store the owner id.
 
override void Render (SDL_Renderer *renderer, SDL_Rect *camera)
 Render the given script.
 
- Public Member Functions inherited from IComponent

Public Attributes

ComponentTransform mTransform
 The ComponentTransform of the linked GameObject.
 
SDL_Rect * mCamera
 The current camera position and size.
 

Detailed Description

Handle a mouse click on a texture-based GameObject.

Constructor & Destructor Documentation

◆ this()

ComponentTransformMouseClick::this ( size_t owner,
void delegate() callbackFunction,
ComponentTransform transform,
SDL_Rect * camera )
inline

Set up the script.

Parameters
ownerthe id of the linked GameObject.
callbackFunctionthe callback.
transformthe ComponentTransform of the linked GameObject.
callbackFunctionthe current camera position and size.

Member Function Documentation

◆ Update()

override void ComponentTransformMouseClick::Update ( )
inlinevirtual

Update internal state of the script.

Implements ComponentScript.


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