mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
fix dyn joystick bounds
This commit is contained in:
parent
20fc603c19
commit
56585a5fd9
1 changed files with 4 additions and 1 deletions
|
|
@ -105,7 +105,9 @@ class MovementInput {
|
|||
|
||||
public function moveToFinger(e:hxd.Event) {
|
||||
var size = Settings.touchSettings.joystickSize;
|
||||
this.area.graphics.setPosition(e.relX - size * 3, e.relY - size * 3);
|
||||
var scene2d = collider.getScene();
|
||||
this.area.graphics.setPosition(Util.clamp(e.relX - size * 3, 0, scene2d.width / 2 - size * 6),
|
||||
Util.clamp(e.relY - size * 3, 0, scene2d.height - size * 6));
|
||||
this.collider.onPush(e);
|
||||
}
|
||||
|
||||
|
|
@ -125,6 +127,7 @@ class MovementInput {
|
|||
}
|
||||
|
||||
public function dispose() {
|
||||
this.collider.stopCapture();
|
||||
this.area.dispose();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue