mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
fix portrait mode side buttons
This commit is contained in:
@@ -203,10 +203,12 @@ public class GameHUD extends Stage {
|
|||||||
float displayY = ui.getY();
|
float displayY = ui.getY();
|
||||||
float displayT = ui.getTop();
|
float displayT = ui.getTop();
|
||||||
float displayR = ui.getRight();
|
float displayR = ui.getRight();
|
||||||
|
//menu Y bounds
|
||||||
|
float menuY = menuActor.getY();
|
||||||
//auto follow touchpad
|
//auto follow touchpad
|
||||||
if (GuiBase.isAndroid()) {
|
if (GuiBase.isAndroid()) {
|
||||||
if (!(touch.x>=mMapX&&touch.x<=mMapR&&touch.y>=mMapY&&touch.y<=mMapT) // not inside map bounds
|
if (!(touch.x>=mMapX&&touch.x<=mMapR&&touch.y>=mMapY&&touch.y<=mMapT) // not inside map bounds
|
||||||
&& !(touch.x>=uiX&&touch.x<=uiRight&&touch.y>=uiY&&touch.y<=uiTop) //not inside gamehud bounds
|
&& !(touch.x>=uiX&&touch.x<=uiRight&&touch.y>=menuY&&touch.y<=uiTop) //not inside gamehud bounds and menu Y bounds
|
||||||
&& (touch.x>=displayX&&touch.x<=displayR&&touch.y>=displayY&&touch.y<=displayT) //inside display bounds
|
&& (touch.x>=displayX&&touch.x<=displayR&&touch.y>=displayY&&touch.y<=displayT) //inside display bounds
|
||||||
&& pointer < 1) { //not more than 1 pointer
|
&& pointer < 1) { //not more than 1 pointer
|
||||||
touchpad.setBounds(touch.x-TOUCHPAD_SCALE/2, touch.y-TOUCHPAD_SCALE/2, TOUCHPAD_SCALE, TOUCHPAD_SCALE);
|
touchpad.setBounds(touch.x-TOUCHPAD_SCALE/2, touch.y-TOUCHPAD_SCALE/2, TOUCHPAD_SCALE, TOUCHPAD_SCALE);
|
||||||
|
|||||||
Reference in New Issue
Block a user