|
JNGL
Easy to use cross-platform 2D game library
|
Public Types | |
| enum class | Action : uint8_t { NONE , REMOVE , REQUEST_FOCUS } |
Public Member Functions | |
| Widget (jngl::Vec2 position) | |
| Creates a Widget centered at position. | |
| Widget (Widget &&) noexcept=default | |
| Widget & | operator= (Widget &&) noexcept=default |
| virtual Action | step () |
| Steps all Effects. | |
| virtual void | draw (Mat3 modelview) const |
| Draws the widget with all effects applied. | |
| virtual void | drawSelf (Mat3 modelview) const =0 |
| Override this function to draw the widget. | |
| void | addEffect (std::unique_ptr< Effect >) |
| template<class T , class... Args> | |
| void | addEffect (Args &&... args) |
| void | removeEffect (Effect *) |
| virtual void | removeEffects () |
| Removes all effects. | |
| jngl::Vec2 | getPosition () const |
| Returns the center. | |
Protected Attributes | |
| jngl::Vec2 | position |
| Center. | |
Definition at line 18 of file Widget.hpp.
|
strong |
Definition at line 27 of file Widget.hpp.
|
nodiscardvirtual |
Steps all Effects.
When Action::REMOVE is returned, the Widget wants to be removed from its container.
|
pure virtual |
Override this function to draw the widget.
Implemented in Label.
|
inline |
Definition at line 47 of file Widget.hpp.
|
protected |
Center.
Definition at line 61 of file Widget.hpp.