mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
ew
This commit is contained in:
parent
ec5662a835
commit
7fe505c6a8
1 changed files with 5 additions and 1 deletions
|
|
@ -21,6 +21,8 @@ class MovementInput {
|
||||||
|
|
||||||
public var value:Vector = new Vector();
|
public var value:Vector = new Vector();
|
||||||
|
|
||||||
|
var capturing = false;
|
||||||
|
|
||||||
var touchId = -1;
|
var touchId = -1;
|
||||||
|
|
||||||
public function new() {
|
public function new() {
|
||||||
|
|
@ -68,6 +70,7 @@ class MovementInput {
|
||||||
|
|
||||||
var stopped = false;
|
var stopped = false;
|
||||||
|
|
||||||
|
capturing = true;
|
||||||
collider.startCapture((emove) -> {
|
collider.startCapture((emove) -> {
|
||||||
if (e.touchId != emove.touchId) {
|
if (e.touchId != emove.touchId) {
|
||||||
emove.propagate = true;
|
emove.propagate = true;
|
||||||
|
|
@ -85,6 +88,7 @@ class MovementInput {
|
||||||
if (emove.kind == ERelease || emove.kind == EReleaseOutside) {
|
if (emove.kind == ERelease || emove.kind == EReleaseOutside) {
|
||||||
stopped = true;
|
stopped = true;
|
||||||
collider.stopCapture();
|
collider.stopCapture();
|
||||||
|
capturing = false;
|
||||||
}
|
}
|
||||||
}, () -> {
|
}, () -> {
|
||||||
if (stopped) {
|
if (stopped) {
|
||||||
|
|
@ -92,6 +96,7 @@ class MovementInput {
|
||||||
this.joystick.graphics.alpha = 0;
|
this.joystick.graphics.alpha = 0;
|
||||||
|
|
||||||
pressed = false;
|
pressed = false;
|
||||||
|
capturing = false;
|
||||||
|
|
||||||
this.value = new Vector(0, 0);
|
this.value = new Vector(0, 0);
|
||||||
}
|
}
|
||||||
|
|
@ -127,7 +132,6 @@ class MovementInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function dispose() {
|
public function dispose() {
|
||||||
this.collider.stopCapture();
|
|
||||||
this.area.dispose();
|
this.area.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue