diff --git a/src/playdate/graphics.nim b/src/playdate/graphics.nim index 5691420..76f877f 100644 --- a/src/playdate/graphics.nim +++ b/src/playdate/graphics.nim @@ -411,9 +411,12 @@ proc set*(this: var LCDBitmap, x, y: int, color: LCDSolidColor = kColorBlack) = var data = this.getData data.set(x, y, color) -proc setStencilImage*(this: ptr PlaydateGraphics, bitmap: LCDBitmap, tile: bool) = +proc setStencilImage*(this: ptr PlaydateGraphics, bitmap: LCDBitmap, tile: bool = false) = privateAccess(PlaydateGraphics) - this.setStencilImage(bitmap.resource, if tile: 1 else: 0) + if bitmap == nil: + this.setStencilImage(nil, if tile: 1 else: 0) + else: + this.setStencilImage(bitmap.resource, if tile: 1 else: 0) proc makeFont*(this: LCDFontData, wide: bool): LCDFont = privateAccess(PlaydateGraphics)