Ember
A C++ 20 'game engine' built with SDL3 with wide platform support.
Public Member Functions | List of all members
Label Class Referencefinal

#include <label.h>

Inheritance diagram for Label:
Node2D

Public Member Functions

 Label (const std::string &font_alias, const std::string &text, const int ft_size=0, const Color &color=Color::WHITE)
 
 Label (const std::string &font_path, const std::string &font_alias, const std::string &text, int ft_size=16, const Color &color=Color::WHITE)
 
void ready () override
 
void process (double delta_time) override
 
void draw (Renderer *renderer) override
 
std::string get_text () const
 
void set_text (const char *fmt,...)
 
void set_font_size (float size)
 
void set_text_color (const Color &color)
 
void set_outline (bool enabled, float thickness=1.f, const Color &color=Color::BLACK)
 
void set_shadow (bool enabled, glm::vec2 offset=glm::vec2(-1.f), const Color &color=Color::BLACK)
 
void input (const InputManager *input) override
 
void draw_inspector () override
 
void draw_hierarchy () override
 
 ~Label () override
 
- Public Member Functions inherited from Node2D
 Node2D ()
 
 Node2D (std::string name)
 
void set_z_index (int index)
 
int get_z_index () const
 
int get_effective_z_index () const
 
void print_tree (int indent=0) const
 
void change_visibility (bool visible)
 
void translate (float dx, float dy)
 
void rotate (float radians)
 
void scale (float sx, float sy)
 
Transform2D get_global_transform () const
 
Transform2D get_transform () const
 
void set_transform (const Transform2D &transform)
 
void add_child (const std::string &base_name, Node2D *node)
 
Node2Dget_node (const std::string &path)
 
template<typename T >
T * get_node ()
 
void queue_free ()
 
virtual ~Node2D ()
 
const std::string & get_name () const
 
bool is_visible () const
 
bool is_effective_visible () const
 
HashMap< std::string, Node2D * > & get_tree ()
 
bool is_alive () const
 

Additional Inherited Members

- Protected Attributes inherited from Node2D
Transform2D _transform = {}
 
std::string _name = "Node"
 
int _z_index = 0
 
bool _is_visible = true
 
bool _is_ready = false
 
bool _to_free = false
 

Constructor & Destructor Documentation

◆ Label() [1/2]

Label::Label ( const std::string &  font_alias,
const std::string &  text,
const int  ft_size = 0,
const Color color = Color::WHITE 
)
inlineexplicit

◆ Label() [2/2]

Label::Label ( const std::string &  font_path,
const std::string &  font_alias,
const std::string &  text,
int  ft_size = 16,
const Color color = Color::WHITE 
)

◆ ~Label()

Label::~Label ( )
override

Member Function Documentation

◆ draw()

void Label::draw ( Renderer renderer)
overridevirtual

Reimplemented from Node2D.

◆ draw_hierarchy()

void Label::draw_hierarchy ( )
overridevirtual

Reimplemented from Node2D.

◆ draw_inspector()

void Label::draw_inspector ( )
overridevirtual

Reimplemented from Node2D.

◆ get_text()

std::string Label::get_text ( ) const

◆ input()

void Label::input ( const InputManager input)
overridevirtual

Reimplemented from Node2D.

◆ process()

void Label::process ( double  delta_time)
overridevirtual

Reimplemented from Node2D.

◆ ready()

void Label::ready ( )
overridevirtual

Reimplemented from Node2D.

◆ set_font_size()

void Label::set_font_size ( float  size)

◆ set_outline()

void Label::set_outline ( bool  enabled,
float  thickness = 1.f,
const Color color = Color::BLACK 
)

◆ set_shadow()

void Label::set_shadow ( bool  enabled,
glm::vec2  offset = glm::vec2(-1.f),
const Color color = Color::BLACK 
)

◆ set_text()

void Label::set_text ( const char *  fmt,
  ... 
)

◆ set_text_color()

void Label::set_text_color ( const Color color)

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