-
Notifications
You must be signed in to change notification settings - Fork 171
/
gui2_canvas.h
31 lines (25 loc) · 878 Bytes
/
gui2_canvas.h
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
#ifndef GUI2_CANVAS_H
#define GUI2_CANVAS_H
#include "engine.h"
#include "gui2_container.h"
class GuiCanvas : public Renderable, public GuiContainer, public InputEventHandler
{
private:
GuiElement* click_element;
GuiElement* focus_element;
sf::Vector2f previous_mouse_position;
sf::Vector2f previous_joystick_xy_position;
float previous_joystick_z_position;
float previous_joystick_r_position;
bool enable_debug_rendering;
public:
GuiCanvas();
virtual ~GuiCanvas();
virtual void render(sf::RenderTarget& window);
virtual void handleKeyPress(sf::Keyboard::Key key, int unicode);
virtual void onClick(sf::Vector2f mouse_position);
virtual void onKey(sf::Keyboard::Key key, int unicode);
//Called when an element is destroyed in this tree.
void unfocusElement(GuiElement* element);
};
#endif//GUI2_CANVAS_H