-
Notifications
You must be signed in to change notification settings - Fork 0
/
GUI_TextField.h
39 lines (27 loc) · 960 Bytes
/
GUI_TextField.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
32
33
34
35
36
37
38
39
#ifndef GUI_TEXTFIELD_H
#define GUI_TEXTFIELD_H
//--------------------------------------------------------------------------------
#include <string>
#include "GUI_Widget.h"
#include "SDL_ttf.h"
//--------------------------------------------------------------------------------
// pole tekstowe
class GUI_TextField : public GUI_Widget
{
protected:
TTF_Font *font; // czcionka
SDL_Color color; // kolor tekstu
SDL_Surface *txtSurface; // powierzchnia tekstu
std::string text; // tekst
public:
GUI_TextField(int _x, int _y, int _width, int _height, TTF_Font *_font, SDL_Color _color, std::string _str = "");
virtual ~GUI_TextField(void);
// ustawienie tekstu
virtual void SetText(std::string str);
// ustawienie koloru tekstu
void SetColor(SDL_Color _color);
// renderowanie widgetu
virtual void Render(SDL_Surface *dest);
};
//--------------------------------------------------------------------------------
#endif