From 391f7fd6d832cb40f74fb37f9e0af7ff33db202f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 20 Apr 2018 01:29:54 +0200 Subject: Add message board, in the middle of text selection --- include/MessagePart.hpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 include/MessagePart.hpp (limited to 'include/MessagePart.hpp') diff --git a/include/MessagePart.hpp b/include/MessagePart.hpp new file mode 100644 index 0000000..e50852a --- /dev/null +++ b/include/MessagePart.hpp @@ -0,0 +1,38 @@ +#pragma once + +#include +#include +#include + +namespace dchat +{ + class MessagePart + { + public: + enum class Type + { + TEXT + }; + + MessagePart(Type _type) : type(_type) {} + virtual ~MessagePart(){} + + static float getSizeScaled(); + virtual sf::Vector2f getPosition() const = 0; + virtual sf::Vector2f getSize() const = 0; + + const Type type; + }; + + class MessagePartText : public MessagePart + { + public: + MessagePartText(const std::string &text); + + static float getFontSizeScaled(); + virtual sf::Vector2f getPosition() const override; + virtual sf::Vector2f getSize() const override; + + sf::Text text; + }; +} -- cgit v1.2.3