TGUI  v0.6.10
Public Member Functions | List of all members
tgui::Transformable Class Referenceabstract
Inheritance diagram for tgui::Transformable:
tgui::Widget tgui::ChatBox tgui::ClickableWidget tgui::ComboBox tgui::Container tgui::Knob tgui::ListBox tgui::MenuBar tgui::Scrollbar tgui::Slider tgui::Tab tgui::TextBox

Public Member Functions

 Transformable ()
 Default constructor. More...
 
virtual ~Transformable ()
 Destructor. More...
 
virtual void setPosition (float x, float y)
 Set the position of the widget. More...
 
void setPosition (const sf::Vector2f &position)
 set the position of the widget More...
 
const sf::Vector2f & getPosition () const
 get the position of the widget More...
 
void move (float offsetX, float offsetY)
 Move the widget by a given offset. More...
 
void move (const sf::Vector2f &offset)
 Move the widget by a given offset. More...
 
virtual void setSize (float width, float height)=0
 Changes the size of the widget. More...
 
virtual sf::Vector2f getSize () const =0
 Returns the size of the widget. More...
 
virtual sf::Vector2f getFullSize () const
 Returns the entire size that the widget is using. More...
 
void scale (float factorX, float factorY)
 Scale the widget. More...
 
void scale (const sf::Vector2f &factors)
 Scale the widget. More...
 

Constructor & Destructor Documentation

tgui::Transformable::Transformable ( )

Default constructor.

virtual tgui::Transformable::~Transformable ( )
virtual

Destructor.

Member Function Documentation

virtual sf::Vector2f tgui::Transformable::getFullSize ( ) const
virtual

Returns the entire size that the widget is using.

This function will return a value equal or greater than what getSize returns. If the widget would e.g. have borders around it then this function will return the size, including these borders.

Returns
Full size of the widget

Reimplemented in tgui::ChildWindow, tgui::RadioButton, tgui::ChatBox, tgui::TextBox, tgui::ComboBox, and tgui::ListBox.

const sf::Vector2f& tgui::Transformable::getPosition ( ) const

get the position of the widget

Returns
Current position
See also
setPosition
virtual sf::Vector2f tgui::Transformable::getSize ( ) const
pure virtual
void tgui::Transformable::move ( float  offsetX,
float  offsetY 
)

Move the widget by a given offset.

This function adds to the current position of the widget, unlike setPosition which overwrites it. Thus, it is equivalent to the following code:

sf::Vector2f pos = widget.getPosition();
widget.setPosition(pos.x + offsetX, pos.y + offsetY);
Parameters
offsetXX offset
offsetYY offset
See also
setPosition
void tgui::Transformable::move ( const sf::Vector2f &  offset)

Move the widget by a given offset.

This function adds to the current position of the widget, unlike setPosition which overwrites it. Thus, it is equivalent to the following code:

widget.setPosition(widget.getPosition() + offset);
Parameters
offsetOffset
See also
setPosition
void tgui::Transformable::scale ( float  factorX,
float  factorY 
)

Scale the widget.

Parameters
factorXHorizontal scale factor
factorYVertical scale factor

This function multiplies the current size of the widget with the given scale factors. Thus, it is equivalent to the following code:

widget.setSize(getSize().x * factorX, getSize().y * factorY);
void tgui::Transformable::scale ( const sf::Vector2f &  factors)

Scale the widget.

Parameters
factorsScale factors

This function multiplies the current size of the widget with the given scale factors. Thus, it is equivalent to the following code:

widget.setSize(getSize().x * factors.x, getSize().y * factors.y);
virtual void tgui::Transformable::setPosition ( float  x,
float  y 
)
virtual

Set the position of the widget.

This function completely overwrites the previous position. See the move function to apply an offset based on the previous position instead. The default position of a transformable widget is (0, 0).

Parameters
xX coordinate of the new position
yY coordinate of the new position
See also
move, getPosition

Reimplemented in tgui::ChildWindow, tgui::EditBox, tgui::Picture, tgui::Button, tgui::Knob, tgui::RadioButton, tgui::Slider, tgui::Label, and tgui::Canvas.

void tgui::Transformable::setPosition ( const sf::Vector2f &  position)

set the position of the widget

This function completely overwrites the previous position. See the move function to apply an offset based on the previous position instead. The default position of a transformable widget is (0, 0).

Parameters
positionNew position
See also
move, getPosition
virtual void tgui::Transformable::setSize ( float  width,
float  height 
)
pure virtual

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