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 input;
|
||||
//import input;
|
||||
|
||||
/*
|
||||
//input settings, mapping SDL2's virtual keys to event names
|
||||
|
||||
@@ -6,12 +6,12 @@ var x: int = 50;
|
||||
var y: int = 50;
|
||||
|
||||
//accessors
|
||||
fn getX() {
|
||||
fn getX(node: opaque) {
|
||||
print "Called getX";
|
||||
return x;
|
||||
}
|
||||
|
||||
fn getY() {
|
||||
fn getY(node: opaque) {
|
||||
return y;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ fn onFree(node: opaque) {
|
||||
}
|
||||
|
||||
fn onDraw(node: opaque) {
|
||||
//print "render.toy:onDraw() called";
|
||||
print "render.toy:onDraw() called";
|
||||
|
||||
var px = parent.callNode("getX");
|
||||
var py = parent.callNode("getY");
|
||||
|
||||
@@ -17,13 +17,7 @@ fn onInit(node: opaque) {
|
||||
// node.makeChild("assets/scripts/child.toy");
|
||||
node.makeChild("assets/scripts/render.toy");
|
||||
|
||||
print node;
|
||||
print node.getNodeChild(0);
|
||||
|
||||
var o = node.getNodeChild(0);
|
||||
print o.callNode("getX");
|
||||
|
||||
print node.getNodeChild(0).callNode("getX");
|
||||
node.getNodeChild(0).makeChild("assets/scripts/render.toy");
|
||||
}
|
||||
|
||||
fn onStep(node: opaque) {
|
||||
|
||||
@@ -559,10 +559,13 @@ static int nativeCallNode(Interpreter* interpreter, LiteralArray* arguments) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
//call the function
|
||||
Literal result = callEngineNodeLiteral(AS_OPAQUE(nodeLiteral), interpreter, fnName);
|
||||
char* strptr = AS_STRING(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
|
||||
freeLiteral(nodeLiteral);
|
||||
|
||||
Reference in New Issue
Block a user