Skip to content

Commit

Permalink
Default to UTF8 when drawing text
Browse files Browse the repository at this point in the history
  • Loading branch information
Nycto committed Nov 25, 2023
1 parent c7d9bac commit 2be33c4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/playdate/graphics.nim
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ proc drawScaled*(this: LCDBitmap, x: int, y: int, xScale: float, yScale: float)
privateAccess(PlaydateGraphics)
playdate.graphics.drawScaledBitmap(this.resource, x.cint, y.cint, xScale.cfloat, yScale.cfloat)

proc drawText*(this: ptr PlaydateGraphics, text: string, x: int, y: int): int {.discardable.} =
proc drawText*(
this: ptr PlaydateGraphics;
text: string;
x, y: int;
encoding: PDStringEncoding = kUTF8Encoding
): int {.discardable.} =
privateAccess(PlaydateGraphics)
return playdate.graphics.drawText(text.cstring, len(text).csize_t, kASCIIEncoding, x.cint, y.cint).int

Expand Down

0 comments on commit 2be33c4

Please sign in to comment.