diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-11-03 10:49:19 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-11-03 10:49:19 +0100 |
commit | ed8534e2d150428bcbc4a6df8940323ae8db2925 (patch) | |
tree | b8c2402d13a4de190539e781c037c69d779cf95a /mwe/events/include/uiObject.h | |
parent | 5e833bba513d97c39f4e0d26b45a9095c32812a6 (diff) |
fixed gameloop double window and event poc is working again
Diffstat (limited to 'mwe/events/include/uiObject.h')
-rw-r--r-- | mwe/events/include/uiObject.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/mwe/events/include/uiObject.h b/mwe/events/include/uiObject.h index 720d5c2..893232d 100644 --- a/mwe/events/include/uiObject.h +++ b/mwe/events/include/uiObject.h @@ -53,17 +53,18 @@ class Text : public UIObject{ TTF_Font *font; RGBColor color; }; -class TextInput : public UIObject{ - public: - TextInput (int width,int height); - std::string textBuffer; +class TextInput : public UIObject { +public: + TextInput(int width, int height); + std::string textBuffer; std::string placeholder; - size_t caretPosition; - bool isActive; + bool isActive = false; RGBColor textColor; RGBColor backgroundColor; - size_t maxLength; + size_t maxLength = 100; Alignment alignment; - TTF_Font* font; - EventHandler<TextSubmitEvent> onSubmit; + TTF_Font* font = nullptr; + std::function<void()> onSubmit; + std::function<void()> onFocus; }; + |