armory/Sources/armory/logicnode/GetTouchMovementNode.hx

27 lines
533 B
Haxe
Raw Permalink Normal View History

2020-09-20 20:10:01 +02:00
package armory.logicnode;
import iron.math.Vec4;
class GetTouchMovementNode 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();
var multX: Float = inputs[0].get();
var multY: Float = inputs[1].get();
return switch (from) {
case 0: touch.movementX;
case 1: touch.movementY;
case 2: touch.movementX * multX;
case 3: touch.movementY * multY;
2020-10-01 21:05:47 +02:00
default: null;
2020-09-20 20:10:01 +02:00
}
}
}