Discord
Login
Community
DARK THEME

I'm having issues.

Can anyone tell me how to add text to my game?

just use screen.drawText("my text",x,y,30,"rgb(197,0,0)")

For this to work, you need to have a draw function and a screen.clear() function. like this code

draw = function() screen.clear() screen.drawText("hello",0,0,30,"rgb(197,0,0)") end

ummmmm, so I just consistently tried that code thing, but um it didn't work. I don't think Im doing it right so can you give me some more context?

in a fresh project it should look like so:

init = function()
end

update = function()
end

draw = function()
end

to draw text you can just do this within the draw function;

screen.clear()
screen.drawText("hello world",0,0,16,"white")

it would look like this:

init = function()
end

update = function()
end

draw = function()
  screen.clear()
  screen.drawText("hello world",0,0,16,"white")
end

just for the sake of making sure, press the triangle above the game window to start it

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community