Public Types | Public Member Functions | List of all members
ime::ui::LabelRenderer Class Reference

A Label widget renderer. More...

#include <LabelRenderer.h>

Inheritance diagram for ime::ui::LabelRenderer:
ime::ui::IWidgetRenderer

Public Types

using Ptr = std::unique_ptr< IWidgetRenderer >
 Unique renderer pointer. More...
 

Public Member Functions

void setBorders (const Borders &borders)
 Change the ize of the widget borders. More...
 
Borders getBorders () const
 Get the ize of the widgets borders. More...
 
void setPadding (const Padding &padding)
 Set the size of the padding. More...
 
Padding getPadding () const
 Get the padding of the label. More...
 
void setTextColour (Colour colour)
 Set the colour of the text that is optionally displayed on top of the progress bar. More...
 
Colour getTextColour () const
 Get the colour of the text that is optionally displayed on top of the progress bar. More...
 
void setBackgroundColour (Colour colour)
 Set the background colour of the label. More...
 
Colour getBackgroundColour () const
 Get the background colour of the label. More...
 
void setBorderColour (Colour colour)
 Set the border colour. More...
 
Colour getBorderColour () const
 Get the border colour. More...
 
void setTextStyle (TextStyle style)
 Set the text style. More...
 
TextStyle getTextStyle () const
 Get the text style. More...
 
void setTextOutlineColour (Colour outlineColour)
 Set the outline colour of the text. More...
 
Colour getTextOutlineColour () const
 Get the outline colour text. More...
 
void setTextOutlineThickness (float outlineThickness)
 Set the outline thickness of the text. More...
 
float getTextOutlineThickness () const
 Get the outline thickness of the text. More...
 
void setBackgroundTexture (const std::string &filename)
 Set the background image of the label. More...
 
void setScrollbarWidth (float scrollbarWidth)
 Set the width of the scrollbar. More...
 
float getScrollbarWidth () const
 Get the scroll bar width. More...
 
void setOpacity (float opacity) override
 Set the opacity of the widget. More...
 
float getOpacity () const override
 Get the opacity of the widget. More...
 
void setOpacityDisabled (float opacity) override
 Set the opacity of the widget when it is disabled. More...
 
float getOpacityDisabled () const override
 Get the opacity of the widget when it is disabled. More...
 
void setFont (const std::string &filename) override
 Change the widgets font. More...
 
void ignoreTransparentTexture (bool ignoreTransparentParts) override
 Set whether mouse events should be ignored on transparent parts of the texture of the widget in normal state. More...
 
bool isTransparentTextureIgnored () const override
 Check if mouse events are ignored on transparent parts of the texture or not. More...
 
IWidgetRenderer::Ptr clone () const override
 Create a copy of the render. More...
 
void setInternalPtr (tgui::WidgetRenderer *renderer) override
 
tgui::WidgetRenderer * getInternalPtr () override
 
 ~LabelRenderer () override
 Destructor. More...
 

Detailed Description

A Label widget renderer.

This class allows you to manipulate the render properties of a Label

Definition at line 44 of file LabelRenderer.h.

Member Typedef Documentation

◆ Ptr

using ime::ui::IWidgetRenderer::Ptr = std::unique_ptr<IWidgetRenderer>
inherited

Unique renderer pointer.

Definition at line 75 of file IWidgetRenderer.h.

Constructor & Destructor Documentation

◆ ~LabelRenderer()

ime::ui::LabelRenderer::~LabelRenderer ( )
override

Destructor.

Member Function Documentation

◆ clone()

IWidgetRenderer::Ptr ime::ui::LabelRenderer::clone ( ) const
overridevirtual

Create a copy of the render.

Returns
A copy of the render

Implements ime::ui::IWidgetRenderer.

◆ getBackgroundColour()

Colour ime::ui::LabelRenderer::getBackgroundColour ( ) const

Get the background colour of the label.

Returns
The background colour of the label

◆ getBorderColour()

Colour ime::ui::LabelRenderer::getBorderColour ( ) const

Get the border colour.

Returns
The border colour

◆ getBorders()

Borders ime::ui::LabelRenderer::getBorders ( ) const

Get the ize of the widgets borders.

Returns
The size of the widgets borders

◆ getInternalPtr()

tgui::WidgetRenderer * ime::ui::LabelRenderer::getInternalPtr ( )
overridevirtual

◆ getOpacity()

float ime::ui::LabelRenderer::getOpacity ( ) const
overridevirtual

Get the opacity of the widget.

Returns
The opacity of the widget

Implements ime::ui::IWidgetRenderer.

◆ getOpacityDisabled()

float ime::ui::LabelRenderer::getOpacityDisabled ( ) const
overridevirtual

Get the opacity of the widget when it is disabled.

Returns
The opacity of the widget in disabled state

This function will return -1 if the widget uses the same opacity as the enabled state when it is disabled

Implements ime::ui::IWidgetRenderer.

◆ getPadding()

Padding ime::ui::LabelRenderer::getPadding ( ) const

Get the padding of the label.

Returns
The size of the padding

◆ getScrollbarWidth()

float ime::ui::LabelRenderer::getScrollbarWidth ( ) const

Get the scroll bar width.

Returns
The scroll bar width

◆ getTextColour()

Colour ime::ui::LabelRenderer::getTextColour ( ) const

Get the colour of the text that is optionally displayed on top of the progress bar.

Returns
The colour of the progress bar text

◆ getTextOutlineColour()

Colour ime::ui::LabelRenderer::getTextOutlineColour ( ) const

Get the outline colour text.

Returns
The outline colour of the text

◆ getTextOutlineThickness()

float ime::ui::LabelRenderer::getTextOutlineThickness ( ) const

Get the outline thickness of the text.

Returns
The outline thickness of the text

◆ getTextStyle()

TextStyle ime::ui::LabelRenderer::getTextStyle ( ) const

Get the text style.

Returns
The text style

◆ ignoreTransparentTexture()

void ime::ui::LabelRenderer::ignoreTransparentTexture ( bool  ignoreTransparentParts)
overridevirtual

Set whether mouse events should be ignored on transparent parts of the texture of the widget in normal state.

Parameters
ignoreTransparentPartsTrue to ignore mouse events on transparent parts of the texture, otherwise false

When mouse events are ignored, they are passed to a widget behind the widget. By default, mouse events are NOT ignored and the widget will receive mouse events even on transparent texture parts. This property does nothing if the widget doesn't use textures

Implements ime::ui::IWidgetRenderer.

◆ isTransparentTextureIgnored()

bool ime::ui::LabelRenderer::isTransparentTextureIgnored ( ) const
overridevirtual

Check if mouse events are ignored on transparent parts of the texture or not.

Returns
True if mouse events are ignored, otherwise false
See also
ignoreTransparentTexture

Implements ime::ui::IWidgetRenderer.

◆ setBackgroundColour()

void ime::ui::LabelRenderer::setBackgroundColour ( Colour  colour)

Set the background colour of the label.

Parameters
colourThe background colour to set

The background colour 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.

◆ setBackgroundTexture()

void ime::ui::LabelRenderer::setBackgroundTexture ( const std::string &  filename)

Set the background image of the label.

Parameters
filenameFilename of the background image to set
Exceptions
FileNotFoundExceptionif the specified file cannot be found

When this image is set, the background colour property will be ignored

◆ setBorderColour()

void ime::ui::LabelRenderer::setBorderColour ( Colour  colour)

Set the border colour.

Parameters
colourThe border colour to set

◆ setBorders()

void ime::ui::LabelRenderer::setBorders ( const Borders borders)

Change the ize of the widget borders.

Parameters
bordersThe size of the borders

◆ setFont()

void ime::ui::LabelRenderer::setFont ( const std::string &  filename)
overridevirtual

Change the widgets font.

Parameters
filenameFilename of the new font
Exceptions
FileNotFoundExceptionIf the font cannot be found on the disk

Implements ime::ui::IWidgetRenderer.

◆ setInternalPtr()

void ime::ui::LabelRenderer::setInternalPtr ( tgui::WidgetRenderer *  renderer)
overridevirtual

◆ setOpacity()

void ime::ui::LabelRenderer::setOpacity ( float  opacity)
overridevirtual

Set the opacity of the widget.

Parameters
opacityThe new opacity of the widget in between 0 and 1

0 means completely transparent, while 1 (default) means fully opaque

Implements ime::ui::IWidgetRenderer.

◆ setOpacityDisabled()

void ime::ui::LabelRenderer::setOpacityDisabled ( float  opacity)
overridevirtual

Set the opacity of the widget when it is disabled.

Parameters
opacityOpacity to set between 0 and 1

0 means completely transparent, while 1 (default) means fully opaque. Set to -1 (default) to use the normal opacity value even when the widget is disabled.

Implements ime::ui::IWidgetRenderer.

◆ setPadding()

void ime::ui::LabelRenderer::setPadding ( const Padding padding)

Set the size of the padding.

Parameters
paddingNew size of the padding

◆ setScrollbarWidth()

void ime::ui::LabelRenderer::setScrollbarWidth ( float  scrollbarWidth)

Set the width of the scrollbar.

Parameters
scrollbarWidthRequested scrollbar width or 0 to use the default width (texture size if using textures)

◆ setTextColour()

void ime::ui::LabelRenderer::setTextColour ( Colour  colour)

Set the colour of the text that is optionally displayed on top of the progress bar.

Parameters
colourThe new test colour

◆ setTextOutlineColour()

void ime::ui::LabelRenderer::setTextOutlineColour ( Colour  outlineColour)

Set the outline colour of the text.

Parameters
outlineColourThe outline colour to set

◆ setTextOutlineThickness()

void ime::ui::LabelRenderer::setTextOutlineThickness ( float  outlineThickness)

Set the outline thickness of the text.

Parameters
outlineThicknessThe outline thickness to set

The default outline thickness is 0

◆ setTextStyle()

void ime::ui::LabelRenderer::setTextStyle ( TextStyle  style)

Set the text style.

Parameters
styleTNew text style

The default style is TextStyle::Regular


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