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

Create button GameObjects that receive a click event. More...

Static Public Member Functions

static GameObject CreateStaticButton (string objectName, void delegate() callback, SDL_Renderer *renderer, int xPosition, int yPosition, int width, int height, string jsonPath, SDL_Rect *camera)
 Create a texture-based button.
 
static GameObject CreateTextButton (string objectName, string buttonLabel, void delegate() callback, SDL_Renderer *renderer, int xPosition, int yPosition, SDL_Rect *camera)
 Create a text-based button.
 

Detailed Description

Create button GameObjects that receive a click event.

See also
GameObject

Member Function Documentation

◆ CreateStaticButton()

static GameObject ButtonFactory::CreateStaticButton ( string objectName,
void delegate() callback,
SDL_Renderer * renderer,
int xPosition,
int yPosition,
int width,
int height,
string jsonPath,
SDL_Rect * camera )
inlinestatic

Create a texture-based button.

Parameters
objectNamethe type of GameObject to create.
callbackthe function to call when the button is clicked.
rendererthe SDL renderer object.
xPositionthe initial x coordinate of the GameObject in pixels.
yPositionthe initial y coordinate of the GameObject in pixels.
widththe button width in pixels.
heightthe button height in pixels.
jsonPaththe path to the animation's JSON configuration file.
camerathe viewport camera SDL rectangle object.
Returns
the configured GameObject.
See also
GameObject

◆ CreateTextButton()

static GameObject ButtonFactory::CreateTextButton ( string objectName,
string buttonLabel,
void delegate() callback,
SDL_Renderer * renderer,
int xPosition,
int yPosition,
SDL_Rect * camera )
inlinestatic

Create a text-based button.

Parameters
objectNamethe type of GameObject to create.
buttonLabelthe text to display on the button
callbackthe function to call when the button is clicked.
rendererthe SDL renderer object.
xPositionthe initial x coordinate of the GameObject in pixels.
yPositionthe initial y coordinate of the GameObject in pixels.
camerathe viewport camera SDL rectangle object.
Returns
the configured GameObject.
See also
GameObject

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