Skip to content

Commit

Permalink
Updated game screen touch handler to reflect new icon placement.
Browse files Browse the repository at this point in the history
  • Loading branch information
lanceewing committed Mar 18, 2024
1 parent ac4da06 commit d54144d
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,14 @@ public boolean touchUp(int screenX, int screenY, int pointer, int button) {

if (viewportManager.isPortrait()) {
// Portrait.
if (touchXY.y < 104) {
if (touchXY.x < 104) {
if (touchXY.y < 125) {
if (touchXY.x < 116) {
joystickClicked = true;
} else if (touchXY.x > (viewportManager.getWidth() - 104)) {
} else if (touchXY.x > (viewportManager.getWidth() - 116)) {
backArrowClicked = true;
} else {
int midWidth = (int) (viewportManager.getWidth() - viewportManager.getWidth() / 2);
if ((touchXY.x > (midWidth - 52)) && (touchXY.y < (midWidth + 52))) {
if ((touchXY.x > (midWidth - 58)) && (touchXY.y < (midWidth + 58))) {
fullScreenClicked = true;
}
}
Expand All @@ -334,15 +334,15 @@ public boolean touchUp(int screenX, int screenY, int pointer, int button) {
// Landscape.
int screenTop = (int) viewportManager.getHeight();
if (touchXY.y > (screenTop - 104)) {
if (touchXY.x < 104) {
if (touchXY.x < 112) {
joystickClicked = true;
} else if (touchXY.x > (viewportManager.getWidth() - 104)) {
} else if (touchXY.x > (viewportManager.getWidth() - 112)) {
fullScreenClicked = true;
}
} else if (touchXY.y < 104) {
if (touchXY.x > (viewportManager.getWidth() - 104)) {
if (touchXY.x > (viewportManager.getWidth() - 112)) {
backArrowClicked = true;
} else if (touchXY.x < 104) {
} else if (touchXY.x < 112) {
keyboardClicked = true;
}
}
Expand Down

0 comments on commit d54144d

Please sign in to comment.