Ember
A C++ 20 'game engine' built with SDL3 with wide platform support.
|
2D Node base class for scene graph. More...
#include <node.h>
Public Member Functions | |
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) |
Node2D * | get_node (const std::string &path) |
template<typename T > | |
T * | get_node () |
virtual void | ready () |
virtual void | process (double delta_time) |
virtual void | draw (Renderer *renderer) |
virtual void | input (const InputManager *input) |
virtual void | draw_inspector () |
virtual void | draw_hierarchy () |
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 |
Protected Attributes | |
Transform2D | _transform = {} |
std::string | _name = "Node" |
int | _z_index = 0 |
bool | _is_visible = true |
bool | _is_ready = false |
bool | _to_free = false |
2D Node base class for scene graph.
|
default |
|
inlineexplicit |
|
virtual |
void Node2D::add_child | ( | const std::string & | base_name, |
Node2D * | node | ||
) |
void Node2D::change_visibility | ( | bool | visible | ) |
|
virtual |
Reimplemented in PhysicsObject2D, Sprite2D, RigidBody2D, Polygon2D, Label, and Circle2D.
|
virtual |
Reimplemented in Sprite2D, RigidBody2D, and Label.
|
virtual |
Reimplemented in Sprite2D, RigidBody2D, and Label.
int Node2D::get_effective_z_index | ( | ) | const |
Transform2D Node2D::get_global_transform | ( | ) | const |
const std::string & Node2D::get_name | ( | ) | const |
T * Node2D::get_node |
Node2D * Node2D::get_node | ( | const std::string & | path | ) |
Transform2D Node2D::get_transform | ( | ) | const |
int Node2D::get_z_index | ( | ) | const |
|
virtual |
Reimplemented in Sprite2D, RigidBody2D, and Label.
bool Node2D::is_alive | ( | ) | const |
bool Node2D::is_effective_visible | ( | ) | const |
bool Node2D::is_visible | ( | ) | const |
void Node2D::print_tree | ( | int | indent = 0 | ) | const |
|
virtual |
Reimplemented in Camera2D, PhysicsObject2D, Sprite2D, RigidBody2D, Polygon2D, Label, and Circle2D.
void Node2D::queue_free | ( | ) |
|
virtual |
Reimplemented in PhysicsObject2D, Sprite2D, RigidBody2D, Polygon2D, Label, and Circle2D.
void Node2D::rotate | ( | float | radians | ) |
void Node2D::scale | ( | float | sx, |
float | sy | ||
) |
void Node2D::set_transform | ( | const Transform2D & | transform | ) |
void Node2D::set_z_index | ( | int | index | ) |
void Node2D::translate | ( | float | dx, |
float | dy | ||
) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |