Files
LNXSDK/leenkx/Sources/leenkx/logicnode/SurfaceCoordsNode.hx
2025-01-22 16:18:30 +01:00

30 lines
526 B
Haxe

package leenkx.logicnode;
import iron.math.Vec4;
class SurfaceCoordsNode extends LogicNode {
var coords = new Vec4();
public function new(tree: LogicTree) {
super(tree);
}
override function get(from: Int): Dynamic {
var surface = iron.system.Input.getSurface();
if (from == 0) {
coords.x = surface.x;
coords.y = surface.y;
return coords;
}
else if (from == 1) {
coords.x = surface.movementX;
coords.y = surface.movementY;
return coords;
}
else {
return surface.wheelDelta;
}
}
}