Renders rendering under renders
This commit is contained in:
2
Toy
2
Toy
Submodule Toy updated: cceefa6375...5d240f85a6
@@ -1,5 +1,5 @@
|
|||||||
import engine;
|
import engine;
|
||||||
import input;
|
//import input;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
//input settings, mapping SDL2's virtual keys to event names
|
//input settings, mapping SDL2's virtual keys to event names
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ var x: int = 50;
|
|||||||
var y: int = 50;
|
var y: int = 50;
|
||||||
|
|
||||||
//accessors
|
//accessors
|
||||||
fn getX() {
|
fn getX(node: opaque) {
|
||||||
print "Called getX";
|
print "Called getX";
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn getY() {
|
fn getY(node: opaque) {
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ fn onFree(node: opaque) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn onDraw(node: opaque) {
|
fn onDraw(node: opaque) {
|
||||||
//print "render.toy:onDraw() called";
|
print "render.toy:onDraw() called";
|
||||||
|
|
||||||
var px = parent.callNode("getX");
|
var px = parent.callNode("getX");
|
||||||
var py = parent.callNode("getY");
|
var py = parent.callNode("getY");
|
||||||
|
|||||||
@@ -17,13 +17,7 @@ fn onInit(node: opaque) {
|
|||||||
// node.makeChild("assets/scripts/child.toy");
|
// node.makeChild("assets/scripts/child.toy");
|
||||||
node.makeChild("assets/scripts/render.toy");
|
node.makeChild("assets/scripts/render.toy");
|
||||||
|
|
||||||
print node;
|
node.getNodeChild(0).makeChild("assets/scripts/render.toy");
|
||||||
print node.getNodeChild(0);
|
|
||||||
|
|
||||||
var o = node.getNodeChild(0);
|
|
||||||
print o.callNode("getX");
|
|
||||||
|
|
||||||
print node.getNodeChild(0).callNode("getX");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn onStep(node: opaque) {
|
fn onStep(node: opaque) {
|
||||||
|
|||||||
@@ -559,10 +559,13 @@ static int nativeCallNode(Interpreter* interpreter, LiteralArray* arguments) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//call the function
|
char* strptr = AS_STRING(fnName);
|
||||||
Literal result = callEngineNodeLiteral(AS_OPAQUE(nodeLiteral), interpreter, fnName);
|
Literal fnNameIdentifier = TO_IDENTIFIER_LITERAL(copyString(strptr, strlen(strptr)), strlen(strptr));
|
||||||
|
|
||||||
// pushLiteralArray(&interpreter->stack, result);
|
//call the function
|
||||||
|
Literal result = callEngineNodeLiteral(AS_OPAQUE(nodeLiteral), interpreter, fnNameIdentifier);
|
||||||
|
|
||||||
|
pushLiteralArray(&interpreter->stack, result);
|
||||||
|
|
||||||
//cleanup
|
//cleanup
|
||||||
freeLiteral(nodeLiteral);
|
freeLiteral(nodeLiteral);
|
||||||
|
|||||||
Reference in New Issue
Block a user