Moved more polyfill code into the engine proper

This commit is contained in:
2023-02-28 04:22:37 +11:00
parent 479e38d492
commit d3a3896efe
10 changed files with 139 additions and 67 deletions

View File

@@ -0,0 +1,25 @@
import node;
fn onInit(node: opaque) {
node.loadTexture("sprites:/frametest.png");
//mapped to the given image
node.setNodeRect(0, 0, 32, 32);
node.setNodeFrames(3);
}
var counter = 0;
fn onStep(node: opaque) {
counter++;
if (counter >= 60) {
counter = 0;
node.incrementCurrentNodeFrame();
print "---";
print node.getCurrentNodeFrame();
print node.getNodeFrames();
}
}
fn onDraw(node: opaque) {
node.drawNode(0, 0);
}