Drawing white text on black is not working

I am having trouble drawing a simple white text on a black background.

The documentation states: " To draw white-on-black text (assuming the font you are using is defined in the standard black-on-transparent manner), first call playdate.graphics.setImageDrawMode(playdate.graphics.kDrawModeFillWhite), followed by the appropriate drawText() call."

This is what I have for my code:

import "CoreLibs/object"
import "CoreLibs/graphics"
import "CoreLibs/sprites"

local function initialize()
	playdate.graphics.setImageDrawMode(playdate.graphics.kDrawModeFillWhite)
	playdate.graphics.drawText("Hello World", 50, 50)
end

initialize()

Upon running, this only shows a blank white screen. If I remove the setImageDrawMode, I get a black on white "Hello World". I have tried everything else on this forum, and have had no success. Is there something I'm doing wrong?

Using SDK, Lua, and Windows.

The screen is white by default so you'll need to setbackgroundcolor() or clear() to black.

So you're doing it right, otherwise.

Was able to use playdate.graphics.clear(0) before both the 'setImageDrawMode' and the playdate.graphics.drawText' which resulted in a white on black font. Thank you. This is solved

1 Like