diff options
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; + }; +} |