|
| Node (std::string name) |
| Default constructor.
|
|
virtual | ~Node () |
| Default destructor.
|
|
size_t | AddChild (Node *child) |
| Adds a child to the node and assigns itself as the parent of the new node.
|
|
Node * | GetChild (size_t index) |
| Returns a reference to the child at the specified index.
|
|
Success | RemoveChild (size_t index) |
| Removes the child at the specified index.
|
|
Success | SetEnabled (bool enabled=true) |
| Toggles the state of the node.
|
|
virtual void | OnEnable () |
| Overridable enable method for the node.
|
|
virtual void | OnDisable () |
| Overridable disable method for the node.
|
|
virtual void | Init () |
|
virtual void | Draw () |
| Overridable draw method for the node.
|
|
virtual void | Update (float dt) |
| Overridable update method for the node.
|
|
A single node in a game scene.
Each node is linked with a parent and its children. Nodes can be game objects, scenes, UI elements, etc. There are predefined subclasses, but you can also make your own to manage the behaviour of scenes.
Example
class ExampleNode :
public Node {
public:
Cube mesh;
CubeObject() :
Node(
"Cube") {}
}
class ExampleScene : public Scene {
public:
ExampleNode node;
ExampleScene() : Scene("ExampleScene") {
AddChild(&node);
}
}
A single node in a game scene.
Definition Node.hpp:43
- Author
- Roberto Selles