diff --git a/include/Spectre/Graphics/Text.h b/include/Spectre/Graphics/Text.h index 624a95f..19dfffa 100644 --- a/include/Spectre/Graphics/Text.h +++ b/include/Spectre/Graphics/Text.h @@ -41,6 +41,12 @@ public : void setColor(const Color& color); const Color& getColor() const; + void setOutlineColor(const Color& color); + const Color& getOutlineColor() const; + + void setOutlineSize(unsigned int size); + unsigned int getOutlineSize() const; + Vector2f getSize() const; virtual const std::vector& getVertices() const; @@ -64,6 +70,10 @@ private : Color m_color; + Color m_outlineColor; + + unsigned int m_outlineWidth; + std::vector m_indicies; mutable bool m_geometryNeedsUpdate; diff --git a/source/Graphics/Text.cpp b/source/Graphics/Text.cpp index c539f77..e277d68 100644 --- a/source/Graphics/Text.cpp +++ b/source/Graphics/Text.cpp @@ -4,13 +4,18 @@ Text::Text() : m_font (NULL), -m_color (255, 255, 255, 255) +m_color (255, 255, 255, 255), +m_outlineColor (0, 0, 0, 255), +m_outlineWidth (0) { } Text::Text(const std::string text, const Font& font) : m_font (&font), +m_string (text), m_color (255, 255, 255, 255), +m_outlineColor (0, 0, 0, 255), +m_outlineWidth (0), m_geometryNeedsUpdate (true) { } @@ -47,6 +52,26 @@ const Color& Text::getColor() const return m_color; } +void Text::setOutlineColor(const Color& color) +{ + m_outlineColor = color; +} + +const Color& Text::getOutlineColor() const +{ + return m_outlineColor; +} + +void Text::setOutlineSize(unsigned int size) +{ + m_outlineWidth = size; +} + +unsigned int Text::getOutlineSize() const +{ + return m_outlineWidth; +} + Vector2f Text::getSize() const { Vector2f size;