diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-04-20 01:29:54 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2018-04-20 01:31:23 +0200 |
commit | 391f7fd6d832cb40f74fb37f9e0af7ff33db202f (patch) | |
tree | 1d3e2b54dfade403da579a23029ae98f1a5c8f5b /include/MessagePart.hpp | |
parent | c670ad2839d886107189a5a0d0854a02aa0ace53 (diff) |
Add message board, in the middle of text selection
Diffstat (limited to 'include/MessagePart.hpp')
-rw-r--r-- | include/MessagePart.hpp | 38 |
1 files changed, 38 insertions, 0 deletions
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 <SFML/Graphics/Text.hpp> +#include <SFML/System/Vector2.hpp> +#include <string> + +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; + }; +} |