JNGL
Easy to use cross-platform 2D game library
|
Simple Widget displaying a line of text. More...
#include <jngl/Label.hpp>
Public Member Functions | |
Label (const std::string &str, Font &, Rgb, Vec2 position) | |
void | drawSelf (jngl::Mat3) const override |
Override this function to draw the widget. | |
void | setAlpha (float alpha) |
Set font color alpha from 0...1. | |
void | setAlign (Alignment) |
How to align the label's text, default is CENTER. | |
float | getWidth () const |
Returns the width of the underlying jngl::TextLine. | |
Public Member Functions inherited from Widget | |
Widget (jngl::Vec2 position) | |
Creates a Widget centered at position. | |
virtual Action | step () |
Steps all Effects. | |
virtual void | draw () const |
Draws the widget with all effects applied. | |
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 | |
float | alpha = 1.f |
Protected Attributes inherited from Widget | |
jngl::Vec2 | position |
Center. | |
Additional Inherited Members | |
Public Types inherited from Widget | |
enum class | Action : uint8_t { NONE , REMOVE , REQUEST_FOCUS } |
|
overridevirtual |
Override this function to draw the widget.
Implements Widget.