mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
add ability to make touch controls buttons even smaller
This commit is contained in:
parent
8f30e87d9d
commit
a43a13dbd9
2 changed files with 2 additions and 2 deletions
|
|
@ -81,7 +81,7 @@ class MovementInputEdit extends GuiGraphics {
|
|||
|
||||
var knobPos = new Vector(renderRect.position.x + renderRect.extent.x / 2, renderRect.position.y + 15);
|
||||
|
||||
var newSize = Util.clamp(Math.abs(mouseState.position.y - (renderRect.position.y + renderRect.extent.y / 2)) / 3, 30,
|
||||
var newSize = Util.clamp(Math.abs(mouseState.position.y - (renderRect.position.y + renderRect.extent.y / 2)) / 3, 15,
|
||||
70); // Full size is size * 6
|
||||
var newPos = new Vector(knobPos.x - newSize * 3, mouseState.position.y);
|
||||
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class TouchEditButton extends GuiGraphics {
|
|||
|
||||
if (state == 1) {
|
||||
var renderRect = getHitTestRect();
|
||||
var newRadius = Util.clamp(mouseState.position.sub(renderRect.position.add(renderRect.extent.multiply(0.5))).length(), 30, 80);
|
||||
var newRadius = Util.clamp(mouseState.position.sub(renderRect.position.add(renderRect.extent.multiply(0.5))).length(), 15, 80);
|
||||
this.radius = newRadius;
|
||||
this.extent = new Vector(2 * newRadius, 2 * newRadius);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue