SuperTuxKart
Public Member Functions | Private Attributes | List of all members
FontSettings Class Reference

This class stores settings when rendering fonts, used when instantiating irr::gui::ScalableFont. More...

#include <font_settings.hpp>

Public Member Functions

 FontSettings (bool black_border=false, bool colored_border=false, bool thin_border=false, float scale=1.0f, bool shadow=false, const video::SColor &shadow_color=video::SColor(0, 0, 0, 0), const video::SColor &border_color=video::SColor(0, 0, 0, 0))
 Constructor. More...
 
void setScale (float scale)
 Set the scaling. More...
 
float getScale () const
 Return the scaling. More...
 
void setShadowColor (const video::SColor &col)
 Set the color of shadow. More...
 
const video::SColor & getShadowColor () const
 Return the color of shadow. More...
 
bool useShadow () const
 Return if shadow is enabled. More...
 
void setShadow (bool shadow)
 Set whether shadow is enabled. More...
 
void setBlackBorder (bool border)
 Set whether black border is enabled. More...
 
void setColoredBorder (bool border)
 Set whether a custom colored border is enabled. More...
 
void setThinBorder (bool thin)
 Set whether the text outline should be thin or not. More...
 
void setBorderColor (const video::SColor &col)
 Set the color of border (used when a non-black border is requested). More...
 
const video::SColor & getBorderColor () const
 Return the color of the border. More...
 
bool useBlackBorder () const
 Return if black border is enabled. More...
 
bool useColoredBorder () const
 Return if black border is enabled. More...
 
bool useThinBorder () const
 Return if the border should be thin or not. More...
 

Private Attributes

bool m_black_border
 True if black border will be drawn when rendering. More...
 
bool m_colored_border
 True if a custom colored border will be drawn when rendering. More...
 
bool m_thin_border
 
float m_scale
 Scaling when rendering. More...
 
bool m_shadow
 True if shadow will be drawn when rendering. More...
 
video::SColor m_shadow_color
 Save the color of shadow when rendering. More...
 
video::SColor m_border_color
 Used when m_colored_border is true.
 

Detailed Description

This class stores settings when rendering fonts, used when instantiating irr::gui::ScalableFont.

Constructor & Destructor Documentation

◆ FontSettings()

FontSettings::FontSettings ( bool  black_border = false,
bool  colored_border = false,
bool  thin_border = false,
float  scale = 1.0f,
bool  shadow = false,
const video::SColor &  shadow_color = video::SColor(0, 0, 0, 0),
const video::SColor &  border_color = video::SColor(0, 0, 0, 0) 
)
inline

Constructor.

It will initialize all members with default values if no parameter is given.

Member Function Documentation

◆ getBorderColor()

const video::SColor& FontSettings::getBorderColor ( ) const
inline

Return the color of the border.

◆ getScale()

float FontSettings::getScale ( ) const
inline

Return the scaling.

◆ getShadowColor()

const video::SColor& FontSettings::getShadowColor ( ) const
inline

Return the color of shadow.

◆ setBlackBorder()

void FontSettings::setBlackBorder ( bool  border)
inline

Set whether black border is enabled.

Parameters
borderIf it's enabled.

◆ setBorderColor()

void FontSettings::setBorderColor ( const video::SColor &  col)
inline

Set the color of border (used when a non-black border is requested).

Parameters
colThe color of border to be set.

◆ setColoredBorder()

void FontSettings::setColoredBorder ( bool  border)
inline

Set whether a custom colored border is enabled.

Parameters
borderIf it's enabled.

◆ setScale()

void FontSettings::setScale ( float  scale)
inline

Set the scaling.

Parameters
scaleScaling to be set.

◆ setShadow()

void FontSettings::setShadow ( bool  shadow)
inline

Set whether shadow is enabled.

Parameters
shadowIf it's enabled.

◆ setShadowColor()

void FontSettings::setShadowColor ( const video::SColor &  col)
inline

Set the color of shadow.

Parameters
colThe color of shadow to be set.

◆ setThinBorder()

void FontSettings::setThinBorder ( bool  thin)
inline

Set whether the text outline should be thin or not.

◆ useBlackBorder()

bool FontSettings::useBlackBorder ( ) const
inline

Return if black border is enabled.

◆ useColoredBorder()

bool FontSettings::useColoredBorder ( ) const
inline

Return if black border is enabled.

◆ useShadow()

bool FontSettings::useShadow ( ) const
inline

Return if shadow is enabled.

◆ useThinBorder()

bool FontSettings::useThinBorder ( ) const
inline

Return if the border should be thin or not.

Member Data Documentation

◆ m_black_border

bool FontSettings::m_black_border
private

True if black border will be drawn when rendering.

◆ m_colored_border

bool FontSettings::m_colored_border
private

True if a custom colored border will be drawn when rendering.

If both a black border and a colored border are set to be used, the colored border will take priority.

◆ m_scale

float FontSettings::m_scale
private

Scaling when rendering.

◆ m_shadow

bool FontSettings::m_shadow
private

True if shadow will be drawn when rendering.

◆ m_shadow_color

video::SColor FontSettings::m_shadow_color
private

Save the color of shadow when rendering.


The documentation for this class was generated from the following file: