TGUI  0.9-dev
BackendTextSFML.hpp
1
2//
3// TGUI - Texus' Graphical User Interface
4// Copyright (C) 2012-2021 Bruno Van de Velde (vdv_b@tgui.eu)
5//
6// This software is provided 'as-is', without any express or implied warranty.
7// In no event will the authors be held liable for any damages arising from the use of this software.
8//
9// Permission is granted to anyone to use this software for any purpose,
10// including commercial applications, and to alter it and redistribute it freely,
11// subject to the following restrictions:
12//
13// 1. The origin of this software must not be misrepresented;
14// you must not claim that you wrote the original software.
15// If you use this software in a product, an acknowledgment
16// in the product documentation would be appreciated but is not required.
17//
18// 2. Altered source versions must be plainly marked as such,
19// and must not be misrepresented as being the original software.
20//
21// 3. This notice may not be removed or altered from any source distribution.
22//
24
25
26#ifndef TGUI_BACKEND_TEXT_SFML_HPP
27#define TGUI_BACKEND_TEXT_SFML_HPP
28
29#include <TGUI/Backend/Renderer/BackendText.hpp>
30#include <SFML/Graphics/Text.hpp>
31
33
34namespace tgui
35{
36#ifndef TGUI_REMOVE_DEPRECATED_CODE
37TGUI_IGNORE_DEPRECATED_WARNINGS_START
41 class TGUI_API BackendTextSFML : public BackendText
42 {
43 public:
44
49 void setString(const String& string) override;
50
51
56 void setCharacterSize(unsigned int characterSize) override;
57
58
63 void setFillColor(const Color& color) override;
64
65
70 void setOutlineColor(const Color& color) override;
71
72
77 void setOutlineThickness(float thickness) override;
78
79
84 void setStyle(TextStyles style) override;
85
86
91 void setFont(const std::shared_ptr<BackendFont>& font) override;
92
93
98 TGUI_DEPRECATED("Function should no longer be used") sf::Text& getInternalText();
99
100
105 TGUI_DEPRECATED("Function should no longer be used") const sf::Text& getInternalText() const;
106
107
109 protected:
110
112 // Updates the caches text dimensions
114 TGUI_DEPRECATED("Function should no longer be used") void recalculateSize() {};
115
116
118 // Calculates the extra vertical space that should be included between each line of text
120 TGUI_DEPRECATED("Function should no longer be used") float calculateExtraLineSpace(const sf::Font* font, unsigned int characterSize, unsigned int style);
121
122
124 protected:
125
126 TGUI_DEPRECATED("Member should no longer be used") sf::Text m_text;
127 };
128TGUI_IGNORE_DEPRECATED_WARNINGS_END
129#endif
130}
131
133
134#endif // TGUI_BACKEND_TEXT_SFML_HPP
Text implementation that makes use of SFML.
Definition: BackendTextSFML.hpp:42
void setCharacterSize(unsigned int characterSize) override
Sets the size of the characters.
void setOutlineThickness(float thickness) override
Changes the thickness of the text outline.
void setFont(const std::shared_ptr< BackendFont > &font) override
Changes the font used by the text.
void setStyle(TextStyles style) override
Changes the text style.
void setString(const String &string) override
Changes the text.
void setFillColor(const Color &color) override
Changes the color of the text.
void setOutlineColor(const Color &color) override
Changes the color of the text outline.
Base class for text implementations that depend on the backend.
Definition: BackendText.hpp:41
Wrapper for colors.
Definition: Color.hpp:63
Definition: Font.hpp:57
Wrapper class to store strings.
Definition: String.hpp:79
Wrapper for text styles.
Definition: TextStyle.hpp:58
Definition: Text.hpp:44
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:36