Корабът Радецки - Eight ball pool v 1.0
The documnetation for our physics-themed project.
Button Class Reference

#include <ui_elements.hpp>

Inheritance diagram for Button:
UIElement DrawableManager::Drawable

Public Member Functions

 Button (const char *text, Rectangle bounds, float rotation)
 
virtual ~Button ()
 
bool IsClicked ()
 Checks whether the button has been clicked or not. More...
 
void Draw () override
 Draws the sprites. More...
 
void Update () override
 Updates the spritess. More...
 
- Public Member Functions inherited from UIElement
 UIElement (Rectangle bounds, float rotation)
 
virtual ~UIElement ()=default
 
void SetPosition (Vector2 position)
 
Vector2 GetPosition ()
 
void SetRotation (float rotation)
 
float GetRotation ()
 
void SetSize (Vector2 size)
 
Vector2 GetSize ()
 
- Public Member Functions inherited from DrawableManager::Drawable
 Drawable ()
 Sets the sprites' IDs. More...
 
virtual ~Drawable ()=default
 
virtual void Create ()
 
int GetID ()
 

Protected Attributes

bool is_clicked
 
const char * text
 
Sound hover_sound
 
Sound click_sound
 
- Protected Attributes inherited from UIElement
Rectangle bounds
 
float rotation
 

Constructor & Destructor Documentation

◆ Button()

Button::Button ( const char *  text,
Rectangle  bounds,
float  rotation 
)
inline

◆ ~Button()

virtual Button::~Button ( )
inlinevirtual

Member Function Documentation

◆ Draw()

void Button::Draw ( )
overridevirtual

Draws the sprites.

Reimplemented from DrawableManager::Drawable.

◆ IsClicked()

bool Button::IsClicked ( )

Checks whether the button has been clicked or not.

Returns
bool

◆ Update()

void Button::Update ( )
overridevirtual

Updates the spritess.

Reimplemented from DrawableManager::Drawable.

Member Data Documentation

◆ click_sound

Sound Button::click_sound
protected

◆ hover_sound

Sound Button::hover_sound
protected

◆ is_clicked

bool Button::is_clicked
protected

◆ text

const char* Button::text
protected