-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButton.cpp
More file actions
42 lines (35 loc) · 774 Bytes
/
Button.cpp
File metadata and controls
42 lines (35 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "Button.h"
#include "Loader.h"
Button::Button(GUI* parent, float x, float y, float sx, float sy, std::string& textureFile, std::string description, bool relativePos)
: GUI(parent,x,y,sx,sy,textureFile,relativePos)
{
_type = GUI_BUTTON;
_enabled = true;
_description = description;
}
Button::Button(float x, float y, float sx, float sy, std::string& textureFile) : GUI(x,y,sx,sy,textureFile)
{
_type = GUI_BUTTON;
_enabled = true;
_description = "";
}
Button::Button() : GUI()
{
_type = GUI_BUTTON;
_enabled = true;
_description = "";
}
Button::~Button()
{
}
void Button::update()
{
}
void Button::onClick()
{
if(_enabled) {
if(eventCallback != nullptr) {
eventCallback();
}
}
}