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

Public Member Functions

 ButtonRenderer ()=default
 Default constructor.
 
 ButtonRenderer (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 setTextColor (Color color)
 Changes the color of the text. More...
 
Color getTextColor () const
 Returns the text color. More...
 
void setTextColorHover (Color color)
 Changes the color of the text in the hover state (mouse on button, but not pressed) More...
 
Color getTextColorHover () const
 Returns the text color in the hover state (mouse on button, but not pressed) More...
 
void setTextColorDown (Color color)
 Changes the color of the text in the down state (mouse on button and left mouse button being held down) More...
 
Color getTextColorDown () const
 Returns the text color in the down state (mouse on button and left mouse button being held down) More...
 
void setTextColorDisabled (Color color)
 Changes the color of the text that is used when the button is disabled. More...
 
Color getTextColorDisabled () const
 Returns the text color that is used when the button is disabled. More...
 
void setBackgroundColor (Color color)
 Changes the color of the background. More...
 
Color getBackgroundColor () const
 Returns the background color. More...
 
void setBackgroundColorHover (Color color)
 Changes the color of the background in the hover state (mouse on button, but not pressed) More...
 
Color getBackgroundColorHover () const
 Returns the background color in the hover state (mouse on button, but not pressed) More...
 
void setBackgroundColorDown (Color color)
 Changes the color of the background in the down state (mouse on button and left mouse button being held down) More...
 
Color getBackgroundColorDown () const
 Returns the background color in the down state (mouse on button and left mouse button being held down) More...
 
void setBackgroundColorDisabled (Color color)
 Changes the color of the background that is used when the button is disabled. More...
 
Color getBackgroundColorDisabled () const
 Returns the background color that is used when the button is disabled. More...
 
void setBorderColor (Color color)
 Changes the color of the borders. More...
 
Color getBorderColor () const
 Returns the color of the borders. More...
 
void setBorderColorHover (Color color)
 Changes the color of the borders in the hover state (mouse on button, but not pressed) More...
 
Color getBorderColorHover () const
 Returns the color of the borders in the hover state (mouse on button, but not pressed) More...
 
void setBorderColorDown (Color color)
 Changes the color of the borders in the down state (mouse on button and left mouse button being held down) More...
 
Color getBorderColorDown () const
 Returns the color of the borders in the down state (mouse on button and left mouse button being held down) More...
 
void setBorderColorDisabled (Color color)
 Changes the color of the borders that is used when the button is disabled. More...
 
Color getBorderColorDisabled () const
 Returns the color of the borders that is used when the button is disabled. More...
 
void setTexture (const Texture &texture)
 Change the image that is displayed. More...
 
TexturegetTexture () const
 Returns the image that is displayed. More...
 
void setTextureHover (const Texture &texture)
 Changes the image that is displayed when the mouse is located on top of the button. More...
 
TexturegetTextureHover () const
 Returns the image that is displayed when the mouse is located on top of the button. More...
 
void setTextureDown (const Texture &texture)
 Changes the image that is displayed when the mouse is held down on top of the button. More...
 
TexturegetTextureDown () const
 Returns the image that is displayed when the mouse is held down on top of the button. More...
 
void setTextureDisabled (const Texture &texture)
 Changes the image that is displayed when the button is disabled. More...
 
TexturegetTextureDisabled () const
 Returns the image that is displayed when the button is disabled. More...
 
void setTextureFocused (const Texture &texture)
 Change the image that is drawn on top of the button image when the button is focused. More...
 
TexturegetTextureFocused () const
 Returns the image that is drawn on top of the button image when the button is focused. More...
 
void setTextStyle (TextStyle style)
 Changes the text style. More...
 
TextStyle getTextStyle () const
 Returns text style. More...
 
void setTextStyleHover (TextStyle style)
 Changes the text style in the hover state (mouse on button, but not pressed) More...
 
TextStyle getTextStyleHover () const
 Returns text style in the hover state (mouse on button, but not pressed) More...
 
void setTextStyleDown (TextStyle style)
 Changes the text style in the down state (mouse on button and left mouse button being held down) More...
 
TextStyle getTextStyleDown () const
 Returns text style in the down state (mouse on button and left mouse button being held down) More...
 
void setTextStyleDisabled (TextStyle style)
 Changes the text style that is used when the button is disabled. More...
 
TextStyle getTextStyleDisabled () const
 Returns text style used when the button is disabled. More...
 
- Public Member Functions inherited from tgui::WidgetRenderer
 WidgetRenderer ()=default
 Default constructor.
 
 WidgetRenderer (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

§ ButtonRenderer()

tgui::ButtonRenderer::ButtonRenderer ( 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::ButtonRenderer::getBackgroundColor ( ) const

Returns the background color.

Returns
background color

§ getBackgroundColorDisabled()

Color tgui::ButtonRenderer::getBackgroundColorDisabled ( ) const

Returns the background color that is used when the button is disabled.

Returns
background color

§ getBackgroundColorDown()

Color tgui::ButtonRenderer::getBackgroundColorDown ( ) const

Returns the background color in the down state (mouse on button and left mouse button being held down)

Returns
background color

§ getBackgroundColorHover()

Color tgui::ButtonRenderer::getBackgroundColorHover ( ) const

Returns the background color in the hover state (mouse on button, but not pressed)

Returns
background color

§ getBorderColor()

Color tgui::ButtonRenderer::getBorderColor ( ) const

Returns the color of the borders.

Returns
Border color

§ getBorderColorDisabled()

Color tgui::ButtonRenderer::getBorderColorDisabled ( ) const

Returns the color of the borders that is used when the button is disabled.

Returns
Border color

§ getBorderColorDown()

Color tgui::ButtonRenderer::getBorderColorDown ( ) const

Returns the color of the borders in the down state (mouse on button and left mouse button being held down)

Returns
Border color

§ getBorderColorHover()

Color tgui::ButtonRenderer::getBorderColorHover ( ) const

Returns the color of the borders in the hover state (mouse on button, but not pressed)

Returns
Border color

§ getBorders()

Borders tgui::ButtonRenderer::getBorders ( ) const

Returns the size of the borders.

Returns
border size

§ getTextColor()

Color tgui::ButtonRenderer::getTextColor ( ) const

Returns the text color.

Returns
text color

§ getTextColorDisabled()

Color tgui::ButtonRenderer::getTextColorDisabled ( ) const

Returns the text color that is used when the button is disabled.

Returns
text color

§ getTextColorDown()

Color tgui::ButtonRenderer::getTextColorDown ( ) const

Returns the text color in the down state (mouse on button and left mouse button being held down)

Returns
text color

§ getTextColorHover()

Color tgui::ButtonRenderer::getTextColorHover ( ) const

Returns the text color in the hover state (mouse on button, but not pressed)

Returns
text color

§ getTextStyle()

TextStyle tgui::ButtonRenderer::getTextStyle ( ) const

Returns text style.

Returns
Style of the text

§ getTextStyleDisabled()

TextStyle tgui::ButtonRenderer::getTextStyleDisabled ( ) const

Returns text style used when the button is disabled.

Returns
Style of the text

§ getTextStyleDown()

TextStyle tgui::ButtonRenderer::getTextStyleDown ( ) const

Returns text style in the down state (mouse on button and left mouse button being held down)

Returns
Style of the text

§ getTextStyleHover()

TextStyle tgui::ButtonRenderer::getTextStyleHover ( ) const

Returns text style in the hover state (mouse on button, but not pressed)

Returns
Style of the text

§ getTexture()

Texture& tgui::ButtonRenderer::getTexture ( ) const

Returns the image that is displayed.

Returns
texture of the button

§ getTextureDisabled()

Texture& tgui::ButtonRenderer::getTextureDisabled ( ) const

Returns the image that is displayed when the button is disabled.

Returns
disabled texture

§ getTextureDown()

Texture& tgui::ButtonRenderer::getTextureDown ( ) const

Returns the image that is displayed when the mouse is held down on top of the button.

Returns
down texture

§ getTextureFocused()

Texture& tgui::ButtonRenderer::getTextureFocused ( ) const

Returns the image that is drawn on top of the button image when the button is focused.

Returns
focused texture

§ getTextureHover()

Texture& tgui::ButtonRenderer::getTextureHover ( ) const

Returns the image that is displayed when the mouse is located on top of the button.

Returns
hover texture

§ setBackgroundColor()

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

Changes the color of the background.

Parameters
colorNew background color

Note that this color is ignored when you set an image as background.

§ setBackgroundColorDisabled()

void tgui::ButtonRenderer::setBackgroundColorDisabled ( Color  color)

Changes the color of the background that is used when the button is disabled.

Parameters
colorNew background color

Note that this color is ignored when you set an image as background.

§ setBackgroundColorDown()

void tgui::ButtonRenderer::setBackgroundColorDown ( Color  color)

Changes the color of the background in the down state (mouse on button and left mouse button being held down)

Parameters
colorNew background color

Note that this color is ignored when you set an image as background.

§ setBackgroundColorHover()

void tgui::ButtonRenderer::setBackgroundColorHover ( Color  color)

Changes the color of the background in the hover state (mouse on button, but not pressed)

Parameters
colorNew background color

Note that this color is ignored when you set an image as background.

§ setBorderColor()

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

Changes the color of the borders.

Parameters
colorNew border color

§ setBorderColorDisabled()

void tgui::ButtonRenderer::setBorderColorDisabled ( Color  color)

Changes the color of the borders that is used when the button is disabled.

Parameters
colorNew border color

§ setBorderColorDown()

void tgui::ButtonRenderer::setBorderColorDown ( Color  color)

Changes the color of the borders in the down state (mouse on button and left mouse button being held down)

Parameters
colorNew border color

§ setBorderColorHover()

void tgui::ButtonRenderer::setBorderColorHover ( Color  color)

Changes the color of the borders in the hover state (mouse on button, but not pressed)

Parameters
colorNew border color

§ setBorders()

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

Changes the size of the borders.

Parameters
bordersSize of the borders

§ setTextColor()

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

Changes the color of the text.

Parameters
colorNew text color

§ setTextColorDisabled()

void tgui::ButtonRenderer::setTextColorDisabled ( Color  color)

Changes the color of the text that is used when the button is disabled.

Parameters
colorNew text color

§ setTextColorDown()

void tgui::ButtonRenderer::setTextColorDown ( Color  color)

Changes the color of the text in the down state (mouse on button and left mouse button being held down)

Parameters
colorNew text color

§ setTextColorHover()

void tgui::ButtonRenderer::setTextColorHover ( Color  color)

Changes the color of the text in the hover state (mouse on button, but not pressed)

Parameters
colorNew text color

§ setTextStyle()

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

Changes the text style.

Parameters
styleNew text style

§ setTextStyleDisabled()

void tgui::ButtonRenderer::setTextStyleDisabled ( TextStyle  style)

Changes the text style that is used when the button is disabled.

Parameters
styleNew text style

§ setTextStyleDown()

void tgui::ButtonRenderer::setTextStyleDown ( TextStyle  style)

Changes the text style in the down state (mouse on button and left mouse button being held down)

Parameters
styleNew text style

§ setTextStyleHover()

void tgui::ButtonRenderer::setTextStyleHover ( TextStyle  style)

Changes the text style in the hover state (mouse on button, but not pressed)

Parameters
styleNew text style

§ setTexture()

void tgui::ButtonRenderer::setTexture ( const Texture texture)

Change the image that is displayed.

Parameters
textureThe new texture

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

§ setTextureDisabled()

void tgui::ButtonRenderer::setTextureDisabled ( const Texture texture)

Changes the image that is displayed when the button is disabled.

Parameters
textureThe new disabled texture

§ setTextureDown()

void tgui::ButtonRenderer::setTextureDown ( const Texture texture)

Changes the image that is displayed when the mouse is held down on top of the button.

Parameters
textureThe new down texture

§ setTextureFocused()

void tgui::ButtonRenderer::setTextureFocused ( const Texture texture)

Change the image that is drawn on top of the button image when the button is focused.

Parameters
textureThe new focus texture

§ setTextureHover()

void tgui::ButtonRenderer::setTextureHover ( const Texture texture)

Changes the image that is displayed when the mouse is located on top of the button.

Parameters
textureThe new hover texture

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