Polygon Dash
Loading...
Searching...
No Matches
SceneNode Class Reference

A node in the scene tree. More...

Public Member Functions

 this (string name, GameObject gameObject=null)
 Initialize a new scene tree node.
 
void addChild (SceneNode node)
 Add a child SceneNode.
 
void Update ()
 Recursively update this node's GameObject and all child GameObject nodes.
 
void Render (SDL_Renderer *renderer, SDL_Rect *camera, bool ignore_player=false)
 Recursively render this node's GameObject and all child GameObject nodes.
 
SceneNode Find (string targetName)
 Recursively find a given node in the scene tree.
 

Public Attributes

string name
 The name of the scene tree object.
 
SceneNode parent = null
 The parent SceneNode object (if it exists).
 
SceneNode[] children
 The children SceneNode objects.
 
GameObject gameObject
 The GameObject linked to the current node (if it exists).
 

Detailed Description

A node in the scene tree.

Can be traveres using an ITraversalAlgorithm.

Constructor & Destructor Documentation

◆ this()

SceneNode::this ( string name,
GameObject gameObject = null )
inline

Initialize a new scene tree node.

Parameters
namethe name of the node.
gameObjectthe linked GameObject (optional).

Member Function Documentation

◆ Find()

SceneNode SceneNode::Find ( string targetName)
inline

Recursively find a given node in the scene tree.

Parameters
targetNamethe name of the node to find.
Returns
the first descendent node with the given name.

◆ Render()

void SceneNode::Render ( SDL_Renderer * renderer,
SDL_Rect * camera,
bool ignore_player = false )
inline

Recursively render this node's GameObject and all child GameObject nodes.

Parameters
rendererthe SDL renderer.
camerathe camera location and size.
ignore_playerwhether to ignore the player or not.
See also
GameObject::Render

◆ Update()

void SceneNode::Update ( )
inline

Recursively update this node's GameObject and all child GameObject nodes.

See also
GameObject::Update

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