Added variable argument count to callNode

This commit is contained in:
2022-11-07 05:22:42 +00:00
parent 526efff00c
commit aec5fcab55
6 changed files with 73 additions and 51 deletions

View File

@@ -2,22 +2,22 @@
import engine;
import node;
//util to generate and init a child node of a parent
fn _makeChild(parent: opaque, fname: string) {
var child: opaque = loadNode(fname);
parent.pushNode(child);
child.initNode();
}
//root node can load the whole scene, and essentially act as the scene object
//NOTE: root node can load the whole scene, and essentially act as the scene object
fn onInit(node: opaque) {
print "root.toy:onInit() called";
//make a child
// node.makeChild("assets/scripts/child.toy");
// node.makeChild("assets/scripts/child.toy");
node.makeChild("assets/scripts/render.toy");
node.makeChild("assets/scripts/entity.toy");
node.getNodeChild(0).makeChild("assets/scripts/render.toy");
//give the child a child
node.getNodeChild(0).makeChild("assets/scripts/entity.toy");
}
fn onStep(node: opaque) {