Added node scaling, and a few utility functions
This commit is contained in:
@@ -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?
|
||||
Reference in New Issue
Block a user