-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWidget.hpp
47 lines (37 loc) · 1.03 KB
/
Widget.hpp
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
//
// Created by borysiak on 31.10.2019.
//
#ifndef BGUI_WIDGET_HPP
#define BGUI_WIDGET_HPP
#include "WidgetClickable.hpp"
#include "Resource/Resource.hpp"
#include <memory>
#include <SFML/Graphics/Drawable.hpp>
#include <SFML/Graphics/RenderTarget.hpp>
#include <SFML/Graphics/Transformable.hpp>
enum class WidgetType
{
Widget,
Button,
EditBox,
CheckBox,
};
class Widget :public sf::Drawable, public sf::Transformable, public WidgetClickable
{
public:
Widget();
sf::Vector2f getSize() {return size;}
void setType(WidgetType type);
WidgetType getType() { return type;}
virtual void connectSignalInit();
virtual void setSize(sf::Vector2f size);
virtual bool mouseInWidget(float x, float y);
virtual void loadResourceData(std::array<Resource*,2> resources) = 0;
virtual void updateVertices(const sf::Vector2f & size) = 0;
protected:
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const = 0;
sf::Vector2f size;
private:
WidgetType type;
};
#endif //BGUI_WIDGET_HPP