The drawText function seem to return the width in pixels of the drawn text.
I could not find this in the documentation tho. Might be a nice thing to add
2 Likes
nice find. i use this all the time from the return values of drawTextInRect
does drawText() return width, height, was_truncated
possibly? (like drawTextInRect()
1 Like
Checked, it's just width
It appears there is a bit of a discrepancy here. playdate.graphics.drawText()
does indeed return width
, height
, but playdate.graphics.font:drawText()
only returns width
.
And of course as you noticed both are undocumented.
I'll take a look at cleaning this up and adding to the documentation. Thanks for pointing out the oversight!
3 Likes