Last change
on this file since ca188cc was 699e83a, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 5 years ago |
Add a GameScreen class to render the main gameplay
|
-
Property mode
set to
100644
|
File size:
605 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(UIEvent& 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.