From 70c0be5b2cfb3b9cfe86d5a6e6624e28fb845453 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Tue, 13 Dec 2022 13:29:06 +0100 Subject: Move text to a separate file --- src/graphics/text.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/graphics/text.h (limited to 'src/graphics/text.h') diff --git a/src/graphics/text.h b/src/graphics/text.h new file mode 100644 index 0000000..22179f5 --- /dev/null +++ b/src/graphics/text.h @@ -0,0 +1,17 @@ +#ifndef GRAPHICS_TEXT_H +#define GRAPHICS_TEXT_H +#include"textureFont.h" + +namespace Graphics { + class Text : public sf::Drawable, public sf::Transformable { + private: + TextureFont &font_; + const std::string text_; + sf::VertexArray vertices_; + public: + Text(TextureFont &font, const std::string &text); + virtual void draw(sf::RenderTarget& target, + sf::RenderStates states) const override; + }; +} +#endif // GRAPHICS_TEXT_H -- cgit v1.2.3