/
Textbox.h
37 lines (33 loc) · 909 Bytes
/
Textbox.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
#ifndef TEXTBOX_H_
#define TEXTBOX_H_
#include "entity/GUISprite.h"
namespace anengine
{
class Textbox : public GUISprite
{
struct TextlibInit
{
TextlibInit();
~TextlibInit();
};
static TextlibInit myTexlibInit;
Asset<Texture> myTexture;
void UpdateText();
protected:
virtual void OnPropertyChanged(const PropertyInfo *id, bool implicit);
virtual void OnCreate();
virtual void OnDestroy();
public:
static PropertyInfo ColorProperty;
Property<ColorRGBA> Color;
static PropertyInfo TextProperty;
Property<std::string> Text;
Textbox()
: GUISprite(AssetRef<Texture>()),
Color(&ColorProperty, this),
Text(&TextProperty, this, EventDirection::None, "F")
{ }
virtual ~Textbox() { }
};
};
#endif