aboutsummaryrefslogtreecommitdiffstats
path: root/src/text.hpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2022-07-09 11:27:17 -0400
committerClyne Sullivan <clyne@bitgloo.com>2022-07-09 11:27:17 -0400
commit9562fde36d6d28188210eb6053b9e2f9a9242702 (patch)
tree2f7bbbf62f2418e999af06cfd67f67b54f3649c8 /src/text.hpp
parent57a1eb6fdccb9023557d0a470796f423f063948a (diff)
mouse events; wip ui dialog box
Diffstat (limited to 'src/text.hpp')
-rw-r--r--src/text.hpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/text.hpp b/src/text.hpp
index 1ef2afa..604710d 100644
--- a/src/text.hpp
+++ b/src/text.hpp
@@ -74,7 +74,20 @@ struct Font {
std::basic_string<TextMeshData> buffer;
};
-class TextSystem : public entityx::System<TextSystem>
+struct ShowTextEvent
+{
+ std::string font;
+ float x;
+ float y;
+ std::string text;
+
+ explicit ShowTextEvent(const std::string& _font, float _x, float _y,
+ const std::string& _text) :
+ font(_font), x(_x), y(_y), text(_text) {}
+};
+
+class TextSystem : public entityx::System<TextSystem>,
+ public entityx::Receiver<TextSystem>
{
public:
~TextSystem(void);
@@ -92,6 +105,8 @@ public:
entityx::EventManager& events,
entityx::TimeDelta dt) final;
+ void receive(const ShowTextEvent&);
+
void put(const std::string& font, float x, float y, const std::string& text);
void loadFont(const std::string& name, const std::string& file, int size);