Set leading on some text and check it is correct (GET READY...3, below)
Press menu to open it
Press menu to close it
Confirm that leading of text has changed (GET READY...2, below)
This is strange, because I am not using system font to draw this, but rather a custom font.
eg.
local fnt = gfx.font.new("custom")
fnt:setTracking(2)
fnt:setLeading(5) -- this is changed after using menu
...
fnt:drawText("GET READY!\n 1", 200, 120)
Visuals
Notes
sadly default leading cannot be specified in the .fnt file
Are you using gfx.setFont? I'd expect that the menu font is overwriting the game's currently loaded font, and it's somehow not restoring the state correctly.
weird. I'm not having any luck reproducing it this way:
gfx = playdate.graphics
font = gfx.font.new("Sasser-Small-Caps")
font:setTracking(10)
font:setLeading(10)
function playdate.update()
gfx.clear()
font:drawText("current time:\n\n\n"..tostring(playdate.getCurrentTimeMilliseconds()), 20,20)
end
Recently I'd introduced a setLeading(0) in playdate.gameWillPause() but within a pushContext
So I assumed it would only take effect during the context? I guess?
Is there a list of what functions pushContext applies to?
gfx = playdate.graphics
font = gfx.font.new("Sasser-Small-Caps")
font:setTracking(10)
font:setLeading(10)
function playdate.gameWillPause()
local pauseImg = gfx.image.new(400,240, gfx.kColorBlack)
gfx.pushContext(pauseImg)
font:setLeading(0)
gfx.popContext()
end
function playdate.update()
gfx.clear()
font:drawText("current time:\n\n\n"..tostring(playdate.getCurrentTimeMilliseconds()), 20,20)
end