In lua, it seems I can't get an alignment right. I have a simple compass showing a direction (N, E, W or S). The W is wider than the other letters and ends up not in the center. I tried a few options mentioned in the doc but can't seem to make them work the way I want...
Here are some screenshots
I would like to have the letters always in the center of the surrounding circle.
Here is a simplified version of the code:
local pd <const> = playdate
local gfx <const> = pd.graphics
class("Compass").extends(gfx.sprite)
function Compass:init()
Compass.super.init(self)
self:moveTo(390, 182)
self:add()
end
function Compass:updateDisplay(strDirection)
local imgCompass = gfx.image.new(20, 20)
gfx.pushContext(imgCompass)
gfx.drawText(strDirection, 0, 0)
gfx.popContext()
self:setImage(imgCompass)
end
Any help will be appreciated! Thank you