mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-04-27 13:11:42 +00:00
add ability to make touch controls buttons even smaller
This commit is contained in:
parent
79a388a54a
commit
4611e4b6dc
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 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
|
70); // Full size is size * 6
|
||||||
var newPos = new Vector(knobPos.x - newSize * 3, mouseState.position.y);
|
var newPos = new Vector(knobPos.x - newSize * 3, mouseState.position.y);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ class TouchEditButton extends GuiGraphics {
|
||||||
|
|
||||||
if (state == 1) {
|
if (state == 1) {
|
||||||
var renderRect = getHitTestRect();
|
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.radius = newRadius;
|
||||||
this.extent = new Vector(2 * newRadius, 2 * newRadius);
|
this.extent = new Vector(2 * newRadius, 2 * newRadius);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue