GRA RPG  DM & KK
Projekt na PO3
Button Class Reference

Class to creat object button. More...

#include <Button.h>

Public Member Functions

 Button ()
 Constructor Class Button. More...
 
 Button (String text, int pos_x, int pos_y, Color color, int text_pos_x, int text_pos_y)
 Constructor Class Button

Parameters
text- Text on the button
pos_x- Position width button
pos_y- Position height button
color- Color button
text_pos_x- Position width text on button
text_pos_y- Position height text on button
Returns
More...
 
 ~Button ()
 Destructor Button. More...
 
void setButton (String write, int width, int height, Color color, int pos_x, int pos_y, int pos_x_txt, int pos_y_txt)
 Function to set value

Parameters
write- The inscription that will be shown on the button
width- Width button
height- Height button
color- Color background button
pos_x- Position x button
pos_y- Position y button
pos_x_txt- Possition x text on button
pos_y_txt- Possition y text on button
More...
 
RectangleShape getButton ()
 Function get RectangleShape use to show create graphic button. More...
 
Text getText ()
 Function return object Text to printnig text. More...
 
void setText (string write)
 Function set new text on button. More...
 

Public Attributes

String write
 String to keep text button. More...
 
RectangleShape button
 Object temporary use to create view button. More...
 
Text text
 Object use to show string button. More...
 
Font font
 Object font use load Font used for entering text. More...
 

Detailed Description

Class to creat object button.

Constructor & Destructor Documentation

◆ Button() [1/2]

Button::Button ( )

Constructor Class Button.

◆ Button() [2/2]

Button::Button ( String  text,
int  pos_x,
int  pos_y,
Color  color,
int  text_pos_x,
int  text_pos_y 
)

Constructor Class Button

Parameters
text- Text on the button
pos_x- Position width button
pos_y- Position height button
color- Color button
text_pos_x- Position width text on button
text_pos_y- Position height text on button
Returns

◆ ~Button()

Button::~Button ( )

Destructor Button.

Member Function Documentation

◆ getButton()

RectangleShape Button::getButton ( )

Function get RectangleShape use to show create graphic button.

◆ getText()

Text Button::getText ( )

Function return object Text to printnig text.

◆ setButton()

void Button::setButton ( String  write,
int  width,
int  height,
Color  color,
int  pos_x,
int  pos_y,
int  pos_x_txt,
int  pos_y_txt 
)

Function to set value

Parameters
write- The inscription that will be shown on the button
width- Width button
height- Height button
color- Color background button
pos_x- Position x button
pos_y- Position y button
pos_x_txt- Possition x text on button
pos_y_txt- Possition y text on button

◆ setText()

void Button::setText ( string  write)

Function set new text on button.

Member Data Documentation

◆ button

RectangleShape Button::button

Object temporary use to create view button.

◆ font

Font Button::font

Object font use load Font used for entering text.

◆ text

Text Button::text

Object use to show string button.

◆ write

String Button::write

String to keep text button.