This seems to be new behavior in 3.0.2. Testing with 3.0.1 it works as it always has.
When accessing graphics.getDrawOffset in gameWillPause, it will always be 0,0 regardless of the current value set by the game.
The offset is restored when you close the pause menu - it is only 0,0 when the menu is opened.
This introduced a problem for me that took a minute to track down - I use the drawOffset as the camera location, and save its value when the game is paused. This change resulted in the game storing the camera location as 0 when the game is saved, so resuming a saved game later did not restore the scene correctly. i.e., if the player saved while on the far right side of the scene, when restoring the game from save data they would be on the far left side (camera at 0 rather than -800 for example). I’ve worked around it by keeping a reference to the most recent value rather than accessing the API directly when saving state.
So not a big deal, but since its a new behavior I thought I’d let you know!
Easiest way to to reproduce:
- Create a project that sets the draw offset to an arbitrary coordinate.
- In
gameWillPauseprintgraphics.getDrawOffset() - Pause the game.
- In
3.0.2it will be0,0and in lower versions, it will be that offset you defined.