-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathControl.cpp
48 lines (46 loc) · 1019 Bytes
/
Control.cpp
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
43
44
45
46
47
48
#include"Control.h"
Control::Control()
{
}
Control::Control(const Vector2f & position, const Vector2f & size) : bounds(size)
{
bounds.setPosition(position);
}
bool Control::contains(const Vector2f & point) const
{
return FloatRect(bounds.getGlobalBounds()).contains(point);
}
Vector2f Control::getPosition() const
{
return bounds.getPosition();
}
Vector2f Control::getSize() const
{
return bounds.getSize();
}
void Control::setSize(const Vector2f & size)
{
bounds.setSize(size);
}
void Control::setPosition(const Vector2f & position)
{
bounds.setPosition(position);
}
void Control::setBackgroundColor(Color bkColor)
{
bounds.setFillColor(bkColor);
}
void Control::setBorderColor(Color borderColor)
{
bounds.setOutlineColor(borderColor);
}
void Control::setBorderThickness(float thickness)
{
bounds.setOutlineThickness(thickness);
}
void Control::draw(RenderTarget& target, RenderStates states) const
{
target.draw(bounds, states);
}
Control::~Control()
{}