armory/Sources/armory/logicnode/GetTouchLocationNode.hx

25 lines
419 B
Haxe
Raw Normal View History

2020-09-20 20:10:01 +02:00
package armory.logicnode;
import iron.math.Vec4;
class GetTouchLocationNode extends LogicNode {
var coords = new Vec4();
public function new(tree: LogicTree) {
super(tree);
}
override function get(from: Int): Dynamic {
var touch = iron.system.Input.getSurface();
return switch (from) {
case 0: touch.x;
case 1: touch.y;
case 2: touch.x * -1;
case 3: touch.y * -1;
2020-10-01 21:05:47 +02:00
default: null;
2020-09-20 20:10:01 +02:00
}
}
}