Added node scaling, and a few utility functions

This commit is contained in:
2023-06-24 21:30:33 +10:00
parent d83ef10c1f
commit 0671a89d43
18 changed files with 377 additions and 588 deletions

View File

@@ -2,10 +2,17 @@ import node;
//this is a child of the step counter, which simply renders text
fn customOnDraw(node: opaque, parentX: int, parentY: int) {
node.drawNode(parentX, parentY);
fn onDraw(node: opaque) {
var posX: int = node.getNodePositionX();
var posY: int = node.getNodePositionY();
var scaleX: float = node.getNodeScaleX();
var scaleY: float = node.getNodeScaleY();
node.drawNode(floor(posX * scaleX), floor(posY * scaleY));
}
fn onFree(node: opaque) {
node.freeNodeTexture();
}
}
//TODO: polyfill?