add ability to make touch controls buttons even smaller

This commit is contained in:
RandomityGuy 2024-06-12 12:50:04 +05:30
parent 8f30e87d9d
commit a43a13dbd9
2 changed files with 2 additions and 2 deletions

View file

@ -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);

View file

@ -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);