2.2.0 — Low Battery system warning affected by draw offset

When the Playdate reaches a battery level of 10%, a warning pops up to let the user know they should plug their Playdate in to charge. I just learned that this pop-up doesn't correctly account for gfx.setDrawOffset().

I noticed this in the game Taxi Trouble, which uses draw offsets to manipulate the camera — when the pop-up opens, it displays a copy of the current screenshot with the warning box over-top at world 0, 0, but doesn't correctly set the drawing offset back. So, it has the potential to be drawn at a weird position on-screen (pictured), or even worse entirely off-screen depending on what the position is set to.

BTW, while the topic is up: does this low battery warning call the pd.gameWillPause()/pd.gameWillResume() callbacks when opened & closed? In the Inside docs, it says that these only happen "when the Menu button is pushed", but it looks visually close to the typical System slide-menu so I'm not sure if this also falls under that umbrella.

1 Like

Thanks! I've filed it and we'll take a look when we have a chance.

According to the source code, gameWillPause() and gameWillResume() are called when the low battery warning comes up/is dismissed. So either it does work that way, or it doesn't and it's a bug. :slight_smile:

1 Like