tgui::Transformable::Transformable |
( |
| ) |
|
virtual tgui::Transformable::~Transformable |
( |
| ) |
|
|
virtual |
virtual sf::Vector2f tgui::Transformable::getFullSize |
( |
| ) |
const |
|
virtual |
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 |
Returns the size of the widget.
- Returns
- Size of the widget
Implemented in tgui::GuiContainer, tgui::ChildWindow, tgui::RadioButton, tgui::Knob, tgui::Slider, tgui::ChatBox, tgui::Grid, tgui::Tab, tgui::TextBox, tgui::ComboBox, tgui::ListBox, tgui::Scrollbar, tgui::Canvas, tgui::AnimatedPicture, tgui::ClickableWidget, tgui::Panel, tgui::MenuBar, and tgui::SpriteSheet.
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
-
offsetX | X offset |
offsetY | Y 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
-
- See also
- setPosition
void tgui::Transformable::scale |
( |
float |
factorX, |
|
|
float |
factorY |
|
) |
| |
Scale the widget.
- Parameters
-
factorX | Horizontal scale factor |
factorY | Vertical scale factor |
This function multiplies the current size of the widget with the given scale factors. Thus, it is equivalent to the following code:
void tgui::Transformable::scale |
( |
const sf::Vector2f & |
factors | ) |
|
Scale the widget.
- Parameters
-
This function multiplies the current size of the widget with the given scale factors. Thus, it is equivalent to the following code:
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
-
x | X coordinate of the new position |
y | Y 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
-
- See also
- move, getPosition
virtual void tgui::Transformable::setSize |
( |
float |
width, |
|
|
float |
height |
|
) |
| |
|
pure virtual |
Changes the size of the widget.
- Parameters
-
width | Width of the widget |
height | Height of the widget |
Implemented in tgui::GuiContainer, tgui::EditBox, tgui::Picture, tgui::Button, tgui::ChildWindow, tgui::Knob, tgui::RadioButton, tgui::Slider, tgui::Grid, tgui::Tab, tgui::ChatBox, tgui::TextBox, tgui::ComboBox, tgui::ListBox, tgui::LoadingBar, tgui::Scrollbar, tgui::Slider2d, tgui::SpinButton, tgui::Canvas, tgui::AnimatedPicture, tgui::Label, tgui::ClickableWidget, tgui::Panel, tgui::MenuBar, and tgui::SpriteSheet.
The documentation for this class was generated from the following file: