Public Member Functions | Protected Attributes | List of all members
Label Class Reference

Simple Widget displaying a line of text. More...

#include <jngl/Label.hpp>

Public Member Functions

 Label (const std::string &str, Font &, Color, Vec2 position)
void drawSelf () 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. More...
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

Additional Inherited Members

- Public Types inherited from Widget
enum class  Action { NONE , REMOVE }

Detailed Description

Simple Widget displaying a line of text.

Definition at line 15 of file Label.hpp.

Inheritance diagram for Label:
Collaboration diagram for Label:

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