1
0
Fork 0

Graphics/Text.h: Adding outline width/color.

This commit is contained in:
Henrik Hautakoski 2016-03-29 07:31:52 +02:00
parent 1423a161a4
commit 308e0dff6b
2 changed files with 36 additions and 1 deletions

View file

@ -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<Vertex2D>& getVertices() const;
@ -64,6 +70,10 @@ private :
Color m_color;
Color m_outlineColor;
unsigned int m_outlineWidth;
std::vector<unsigned short> m_indicies;
mutable bool m_geometryNeedsUpdate;

View file

@ -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;