Level H Engine
Public Member Functions | Private Attributes | List of all members
Button Class Reference

A State for a button. More...

#include <Button.h>

Collaboration diagram for Button:
Collaboration graph

Public Member Functions

 Button (std::string buttonImage, std::string buttonHeldSprite, Vec2 inPos, Vec2 inDim)
 Constructs the Button object. More...
 
 Button (std::string buttonImage, std::string buttonHeldSprite, Vec2 inPos)
 Constructs the Button object. More...
 
 ~Button ()
 Destructs the Button object. More...
 
bool input ()
 Handles the Button input. More...
 
void draw ()
 Draws the button. More...
 

Private Attributes

std::string buttonSprite
 The menu sprite. More...
 
std::string buttonHeldSprite
 
bool pressed
 A boolean for if the button is pressed. More...
 
Vec2 pos
 The button position and dimensions. More...
 
Vec2 dim
 

Detailed Description

A State for a button.

Constructor & Destructor Documentation

◆ Button() [1/2]

Button::Button ( std::string  buttonImage,
std::string  buttonHeldSprite,
Vec2  inPos,
Vec2  inDim 
)

Constructs the Button object.

Parameters
buttonImageA path to the image of the button.
buttonHeldSpriteA path to the held image of the button.
posThe position.
dimThe dimensions.
Here is the call graph for this function:

◆ Button() [2/2]

Button::Button ( std::string  buttonImage,
std::string  buttonHeldSprite,
Vec2  inPos 
)

Constructs the Button object.

Parameters
buttonImageA path to the image of the button.
buttonHeldSpriteA path to the held image of the button.
posThe position.
Here is the call graph for this function:

◆ ~Button()

Button::~Button ( )

Destructs the Button object.

Member Function Documentation

◆ draw()

void Button::draw ( )

Draws the button.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ input()

bool Button::input ( )

Handles the Button input.

Returns
If the button is released.
Here is the call graph for this function:

Member Data Documentation

◆ buttonHeldSprite

std::string Button::buttonHeldSprite
private

◆ buttonSprite

std::string Button::buttonSprite
private

The menu sprite.

◆ dim

Vec2 Button::dim
private

◆ pos

Vec2 Button::pos
private

The button position and dimensions.

◆ pressed

bool Button::pressed
private

A boolean for if the button is pressed.


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