aboutsummaryrefslogtreecommitdiffstats
path: root/src/text.hpp
diff options
context:
space:
mode:
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);