TGUI  0.8-dev
tgui::LabelRenderer Class Reference
Inheritance diagram for tgui::LabelRenderer:
tgui::WidgetRenderer

Public Member Functions

 LabelRenderer ()=default
 Default constructor.
 
 LabelRenderer (const std::shared_ptr< RendererData > &data)
 Construct the renderer from renderer data. More...
 
void setBorders (const Borders &borders)
 Changes the size of the borders. More...
 
Borders getBorders () const
 Returns the size of the borders. More...
 
void setPadding (const Padding &padding)
 Changes the size of the padding. More...
 
Padding getPadding () const
 Returns the size of the padding. More...
 
void setTextColor (Color color)
 Changes the color of the text. More...
 
Color getTextColor () const
 Returns the color of the text. More...
 
void setBackgroundColor (Color color)
 Changes the background color of the label. More...
 
Color getBackgroundColor () const
 Returns the background color of the label. More...
 
void setBorderColor (Color color)
 Changes the color of the borders. More...
 
Color getBorderColor () const
 Returns the color of the borders. More...
 
void setTextStyle (TextStyle style)
 Changes the style of the text. More...
 
TextStyle getTextStyle () const
 Returns the style of the text. More...
 
- Public Member Functions inherited from tgui::WidgetRenderer
 WidgetRenderer ()=default
 Default constructor.
 
 WidgetRenderer (const std::shared_ptr< RendererData > &data)
 Construct the renderer from renderer data. More...
 
virtual ~WidgetRenderer ()
 Virtual destructor.
 
void setOpacity (float opacity)
 Changes the opacity of the widget. More...
 
float getOpacity () const
 Returns the opacity of the widget. More...
 
void setFont (Font font)
 Changes the font used for the text in the widget. More...
 
Font getFont () const
 Returns the font associated with the widget (if any) More...
 
void setProperty (const std::string &property, const std::string &value)
 Changes a property of the renderer. More...
 
void setProperty (const std::string &property, ObjectConverter &&value)
 Changes a property of the renderer. More...
 
ObjectConverter getProperty (const std::string &property) const
 Retrieves the value of a certain property. More...
 
const std::map< std::string, ObjectConverter > & getPropertyValuePairs () const
 Gets a map with all properties and their values. More...
 
void subscribe (void *id, const std::function< void(const std::string &property)> &function)
 Subscribes a callback function to changes in the renderer. More...
 
void unsubscribe (void *id)
 Subscribes a callback function to changes in the renderer. More...
 
std::shared_ptr< RendererDatagetData () const
 Returns the renderer data. More...
 
std::shared_ptr< RendererDataclone () const
 Gets a clone of the renderer data. More...
 

Constructor & Destructor Documentation

◆ LabelRenderer()

tgui::LabelRenderer::LabelRenderer ( const std::shared_ptr< RendererData > &  data)
inline

Construct the renderer from renderer data.

Parameters
dataRenderer data to initialize the renderer with

Member Function Documentation

◆ getBackgroundColor()

Color tgui::LabelRenderer::getBackgroundColor ( ) const

Returns the background color of the label.

Returns
background color

◆ getBorderColor()

Color tgui::LabelRenderer::getBorderColor ( ) const

Returns the color of the borders.

Returns
Border color

◆ getBorders()

Borders tgui::LabelRenderer::getBorders ( ) const

Returns the size of the borders.

Returns
border size

◆ getPadding()

Padding tgui::LabelRenderer::getPadding ( ) const

Returns the size of the padding.

Returns
padding size

◆ getTextColor()

Color tgui::LabelRenderer::getTextColor ( ) const

Returns the color of the text.

Returns
text color

◆ getTextStyle()

TextStyle tgui::LabelRenderer::getTextStyle ( ) const

Returns the style of the text.

Returns
The current text style

◆ setBackgroundColor()

void tgui::LabelRenderer::setBackgroundColor ( Color  color)

Changes the background color of the label.

Parameters
colorNew background color

The background color is transparent by default.

When auto-size is enabled (default), then the background is just as big as the text. When a manual size is set, the background will fill this whole area.

◆ setBorderColor()

void tgui::LabelRenderer::setBorderColor ( Color  color)

Changes the color of the borders.

Parameters
colorNew border color

◆ setBorders()

void tgui::LabelRenderer::setBorders ( const Borders borders)

Changes the size of the borders.

Parameters
bordersSize of the borders

◆ setPadding()

void tgui::LabelRenderer::setPadding ( const Padding padding)

Changes the size of the padding.

Parameters
paddingSize of the padding

The padding is the distance between the side of the background and the text.

◆ setTextColor()

void tgui::LabelRenderer::setTextColor ( Color  color)

Changes the color of the text.

Parameters
colorNew text color

◆ setTextStyle()

void tgui::LabelRenderer::setTextStyle ( TextStyle  style)

Changes the style of the text.

The possible styles can be found in the sf::Text::Style enum. You can also pass a combination of multiple styles, for example sf::Text::Bold | sf::Text::Italic. The default style is sf::Text::Regular.

Parameters
styleNew text style

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