User Tools

Site Tools

Create Node


Below is an example demonstrating how you can create a node, via script.

API Areas of Interest


// Define an anonymous function;
// serves as our main loop,
// limits the scope of variables
	// Create a new node
	var oNode = new DzNode();
	// Define a name
	var sName = "My Node";
	// Get a unique label
	var sLabel = Scene.getUniqueTopLevelLabel( sName, oNode );
	// Set the name and label of the node
	oNode.setName( sName.replace( " ", "" ) );
	oNode.setLabel( sLabel );
	// Add the node to the scene
	Scene.addNode( oNode );
// Finalize the function and invoke