- Joined
- Nov 19, 2019
- Messages
- 80
The games can't respond to Window resizes if they don't have focus (but are still visible) right now. It would be nice to be able to respond to it properly.
For now I did some edits to the AndroidGame class inside androidgame.java.
I moved these two lines from onWindowFocusChanged to onResume.
and moved these two lines from onWindowFocusChanged to onStop.
This should be added to the application tag in the manifest.
With those edits: If the game is visible but not focused, it will still run. It will not stop unless the window is not visible to the user.
It may also be nice for games to be able to detect when they lose focus (but are still visible) so they can show pause menus.
For now I did some edits to the AndroidGame class inside androidgame.java.
I moved these two lines from onWindowFocusChanged to onResume.
Code:
_view.onResume();
_game.ResumeGame();
and moved these two lines from onWindowFocusChanged to onStop.
Code:
_game.SuspendGame();
_view.onPause();
This should be added to the application tag in the manifest.
Code:
android:resizeableActivity="true"
With those edits: If the game is visible but not focused, it will still run. It will not stop unless the window is not visible to the user.
It may also be nice for games to be able to detect when they lose focus (but are still visible) so they can show pause menus.