TGUI  v0.5.2
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Public Member Functions | Public Attributes | List of all members
tgui::Label Struct Reference
Inheritance diagram for tgui::Label:
tgui::OBJECT

Public Member Functions

 Label ()
 Default constructor. More...
 
virtual void load (float width, float height, const sf::Color &bkgColor=sf::Color::Transparent)
 Loads the label. More...
 
virtual void setSize (float width, float height)
 Changes the size of the text inside the label. More...
 
virtual Vector2u getSize () const
 Returns the size of the text, unaffected by scaling. More...
 
virtual Vector2f getScaledSize () const
 Returns the size of the text, after the scaling transformation. More...
 
virtual void setText (const sf::String &text)
 Changes the text. More...
 
virtual sf::String getText () const
 Returns the text. More...
 
virtual void setTextFont (const sf::Font &font)
 Changes the font of the text. More...
 
virtual const sf::Font * getTextFont () const
 Returns the font of the text. More...
 
virtual void setTextColor (const sf::Color &color)
 Changes the color of the text. More...
 
virtual const sf::Color & getTextColor () const
 Returns the color of the text. More...
 
virtual void setTextSize (unsigned int size)
 Changes the character size of the text. More...
 
virtual unsigned int getTextSize () const
 Returns the character size of the text. More...
 
virtual void setAutoSize (bool autoSize)
 Changes whether the label is auto-sized or not. More...
 
virtual bool getAutoSize () const
 Returns whether the label is auto-sized or not. More...
 
- Public Member Functions inherited from tgui::OBJECT
 OBJECT ()
 Default constructor. More...
 
 OBJECT (const OBJECT &copy)
 Copy constructor. More...
 
virtual ~OBJECT ()
 Destructor. More...
 
OBJECToperator= (const OBJECT &right)
 Overload of assignment operator. More...
 
virtual void show ()
 Shows the object. More...
 
virtual void hide ()
 Hides the object. More...
 
virtual bool isVisible () const
 Returns true when the object is visible. More...
 
virtual void enable ()
 Enables the object. More...
 
virtual void disable ()
 Disables the object. More...
 
virtual bool isEnabled () const
 Returns true when the object is enabled. More...
 
virtual bool isDisabled () const
 Returns true when the object is disabled. More...
 
virtual bool isLoaded () const
 Returns true when the object is loaded successfully. More...
 
void focus ()
 Focus the object. More...
 
void unfocus ()
 Unfocus the object. More...
 
void focusNextObject ()
 Focuses the next object. More...
 
virtual bool isFocused () const
 Returns true when the object is focused and false otherwise. More...
 
virtual ObjectTypes getObjectType () const
 Returns the type of the object. More...
 
virtual void moveToFront ()
 Places the object before all other objects. More...
 
virtual void moveToBack ()
 Places the object behind all other objects. More...
 

Public Attributes

sf::Color backgroundColor
 The background color of the label. Transparent by default. More...
 

Constructor & Destructor Documentation

tgui::Label::Label ( )

Default constructor.

Member Function Documentation

virtual bool tgui::Label::getAutoSize ( ) const
virtual

Returns whether the label is auto-sized or not.

See Also
setAutoSize
virtual Vector2f tgui::Label::getScaledSize ( ) const
virtual

Returns the size of the text, after the scaling transformation.

Implements tgui::OBJECT.

virtual Vector2u tgui::Label::getSize ( ) const
virtual

Returns the size of the text, unaffected by scaling.

Implements tgui::OBJECT.

virtual sf::String tgui::Label::getText ( ) const
virtual

Returns the text.

virtual const sf::Color& tgui::Label::getTextColor ( ) const
virtual

Returns the color of the text.

virtual const sf::Font* tgui::Label::getTextFont ( ) const
virtual

Returns the font of the text.

virtual unsigned int tgui::Label::getTextSize ( ) const
virtual

Returns the character size of the text.

virtual void tgui::Label::load ( float  width,
float  height,
const sf::Color &  bkgColor = sf::Color::Transparent 
)
virtual

Loads the label.

This function has the same effect as calling setSize, followed by changing backgroundColor.

See Also
setSize
backgroundColor
virtual void tgui::Label::setAutoSize ( bool  autoSize)
virtual

Changes whether the label is auto-sized or not.

When the label is in auto-size mode, the width and height of the label will be changed to fit the text. Otherwise, only the part defined by the size will be visible.

The label is auto-sized by default.

virtual void tgui::Label::setSize ( float  width,
float  height 
)
virtual

Changes the size of the text inside the label.

Only the part of the text that lies within the size will be drawn.

When this function is called, the label will no longer be auto-sizing.

See Also
setAutoSize

Implements tgui::OBJECT.

virtual void tgui::Label::setText ( const sf::String &  text)
virtual

Changes the text.

When the text is auto-sized (default), then the size of the label will be changed to fit the whole text.

See Also
setAutoSize
virtual void tgui::Label::setTextColor ( const sf::Color &  color)
virtual

Changes the color of the text.

virtual void tgui::Label::setTextFont ( const sf::Font &  font)
virtual

Changes the font of the text.

When you don't call this function then the global font will be use. This global font can be changed by changing gloabalFont from the parent.

virtual void tgui::Label::setTextSize ( unsigned int  size)
virtual

Changes the character size of the text.

Member Data Documentation

sf::Color tgui::Label::backgroundColor

The background color of the label. Transparent by default.


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