25 lines
439 B
Plaintext
25 lines
439 B
Plaintext
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);
|
|
} |