On gameWillResume I show a countdown before resuming the game, using a different setDitherPattern() on every tick before fully resuming the game. My issue is that since this countdown + dithering gets set on gameWillResume, when the menu closes, it looks like the normal game for a split second, before the countdown + dithering gets shown.
I tried to use gameWillPause to add the dithering before pausing:
function playdate.gameWillPause() gfx.setColor(gfx.kColorBlack) gfx.setDitherPattern(0.3) gfx.fillRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) end
But this seems to have no effect, maybe the screen never gets updated after gameWillPause is called? Does anybody know?
Yes that’s just what I had tried, and a print in that function does get logged, I just can’t seem to update the screen - I tried different ways e.g. with drawText, fillRect but I can never update the screen from gameWillPause.
And no the offset isn’t the issue either, if I draw something in the update it works fine.
I've been working with the system menu too lately and I might have an answer for you.
GameWillPause takes in information when called, but the updated will not apply until the system menu is closed.
I recommend creating a local image during gameWillPause that covers your screen or system menu (depending on what you’re doing). That way it’s already drawn when you close the menu.
local tempMenuDisplay = gfx.image.new(“images/yourPreDrawnMenuImage”)
gfx.pushContext(tempMenuDisplay)
-- or make a new image and draw to it
gfx.popContext()
pd.setMenuImage(tempMenuDisplay, 0)
*Another Option is to use setMenuImage and use the offset option in the second condition. You can push the “screenshot” it takes of your game when you pause off further to the left. This creates a bouncy slide animation as it moves your image out of the way.