Skip to content

Commit

Permalink
Desktop will now exit full screen when back arrow clicked, since dial…
Browse files Browse the repository at this point in the history
…og won't show in full screen.
  • Loading branch information
lanceewing committed Apr 16, 2024
1 parent 1dc5cda commit 5857c5a
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.badlogic.gdx.Graphics;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.InputAdapter;
import com.badlogic.gdx.Application.ApplicationType;
import com.badlogic.gdx.math.Vector2;

/**
Expand Down Expand Up @@ -405,6 +406,11 @@ else if ((touchXY.y > 0) && (touchXY.y < 128)) {
}

if (backArrowClicked) {
if (Gdx.app.getType().equals(ApplicationType.Desktop) && Gdx.graphics.isFullscreen()) {
// Dialog won't show for desktop unless we exit full screen,
switchOutOfFullScreen();
}

dialogHandler.confirm("Are you sure you want to quit the game?",
new ConfirmResponseHandler() {
@Override
Expand Down

0 comments on commit 5857c5a

Please sign in to comment.