feature/imgui-sdl
Last change
on this file since b01b50c was d8cf709, checked in by Dmitry Portnoy <dportnoy@…>, 4 years ago |
Change UIEvent to also include the original event from the UI library the game gui is currently using, such as SDL or GLFW.
|
-
Property mode
set to
100644
|
File size:
607 bytes
|
Line | |
---|
1 | #ifndef _PANEL_HPP
|
---|
2 | #define _PANEL_HPP
|
---|
3 |
|
---|
4 | #include <vector>
|
---|
5 |
|
---|
6 | #include <SDL2/SDL.h>
|
---|
7 |
|
---|
8 | #include "../game-gui.hpp"
|
---|
9 |
|
---|
10 | #include "ui-element.hpp"
|
---|
11 |
|
---|
12 | // TODO: Allow border color and width to be configurable
|
---|
13 | class Panel : public UIElement {
|
---|
14 | public:
|
---|
15 | Panel(int x, int y, int width, int height, uint32_t color, SDL_Renderer& renderer);
|
---|
16 | ~Panel() override;
|
---|
17 |
|
---|
18 | void addUIElement(UIElement* element);
|
---|
19 |
|
---|
20 | void render(int x, int y) override;
|
---|
21 | void handleEvent(GameEvent& e) override;
|
---|
22 |
|
---|
23 | private:
|
---|
24 | SDL_Texture* texture = nullptr;
|
---|
25 | uint32_t color = 0x00000000;
|
---|
26 |
|
---|
27 | vector<UIElement*> uiElements;
|
---|
28 | };
|
---|
29 |
|
---|
30 | #endif // _PANEL_HPP
|
---|
Note:
See
TracBrowser
for help on using the repository browser.