From ddff0f1b7ea84f6a1321b8eb8a4d47317873d955 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 23 Apr 2018 09:53:31 +0200 Subject: Add word wrap for message board & TODO TODO: Message board is now redrawn every frame. Text should be modified to render on static & dynamic texture -> text & static images on static texture, gif & video on dynamic texture --- include/MessagePart.hpp | 55 ------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 include/MessagePart.hpp (limited to 'include/MessagePart.hpp') diff --git a/include/MessagePart.hpp b/include/MessagePart.hpp deleted file mode 100644 index 00544fb..0000000 --- a/include/MessagePart.hpp +++ /dev/null @@ -1,55 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -namespace dchat -{ - class MessagePart - { - public: - enum class Type - { - TEXT, - EMOJI - }; - - MessagePart(Type _type, bool _newLine) : type(_type), newLine(_newLine) {} - virtual ~MessagePart(){} - - static float getSizeScaled(); - virtual sf::Vector2f getPosition() const = 0; - virtual sf::Vector2f getSize() const = 0; - - const Type type; - bool newLine; - }; - - class MessagePartText : public MessagePart - { - public: - MessagePartText(const std::string &text, bool newLine); - - static float getFontSizeScaled(); - virtual sf::Vector2f getPosition() const override; - virtual sf::Vector2f getSize() const override; - - sf::Text text; - }; - - class MessagePartEmoji : public MessagePart - { - public: - MessagePartEmoji(const std::string &url, bool newLine); - - static float getHeightScaled(); - virtual sf::Vector2f getPosition() const override; - virtual sf::Vector2f getSize() const override; - - sf::Sprite sprite; - std::string url; - bool dirty; - }; -} -- cgit v1.2.3