Files
Airport/assets/scripts/tilemap/renderer-child.toy
2023-07-30 23:40:24 +10:00

27 lines
669 B
Plaintext

//use this dummy child to actually draw to the screen
import standard;
import node;
//lifecycle functions
fn onInit(node: opaque) {
// node.setNodeScaleX(CAMERA_SCALE_X);
// node.setNodeScaleY(CAMERA_SCALE_Y);
}
fn onDraw(node: opaque) {
var posX: int const = node.getNodeWorldPositionX();
var posY: int const = node.getNodeWorldPositionY();
var scaleX: float const = node.getNodeWorldScaleX();
var scaleY: float const = node.getNodeWorldScaleY();
var width: int const = node.getNodeRectW();
var height: int const = node.getNodeRectH();
node.drawNode(
floor(posX * scaleX),
floor(posY * scaleY),
floor(width * scaleX),
floor(height * scaleY)
);
}