Base class for all Velvet UI elements.
More...
#include <Widget.hpp>
|
| | Widget () |
| | Construct a widget with default font loading.
|
| |
| virtual void | handleEvent (const sf::Event &event, sf::RenderWindow &window) |
| | Handle an SFML event.
|
| |
| virtual void | render (sf::RenderWindow &window) |
| | Render this widget.
|
| |
| virtual void | setPosition (float x, float y)=0 |
| | Set top-left position of widget in window coordinates.
|
| |
| virtual sf::Vector2< float > | getDimensions ()=0 |
| | Get widget dimensions used by layout containers.
|
| |
|
| sf::Font | font |
| | Shared font loaded by the base widget.
|
| |
Base class for all Velvet UI elements.
Widget defines the minimal lifecycle used by Velvet:
Custom widgets should derive from Widget and implement the internal update, setPosition, and getDimensions.
◆ Widget()
Construct a widget with default font loading.
◆ getDimensions()
| virtual sf::Vector2< float > Widget::getDimensions |
( |
| ) |
|
|
pure virtual |
◆ handleEvent()
| virtual void Widget::handleEvent |
( |
const sf::Event & |
event, |
|
|
sf::RenderWindow & |
window |
|
) |
| |
|
virtual |
Handle an SFML event.
- Parameters
-
| event | Event propagated from Window. |
| window | Render window used for coordinate mapping. |
Reimplemented in Button, InputField, Slider, and Stack.
◆ render()
| virtual void Widget::render |
( |
sf::RenderWindow & |
window | ) |
|
|
virtual |
◆ setPosition()
| virtual void Widget::setPosition |
( |
float |
x, |
|
|
float |
y |
|
) |
| |
|
pure virtual |
◆ font
Shared font loaded by the base widget.
The documentation for this class was generated from the following file: