I got that to work as well, however, you had to hold the button down to view the text or else it goes back to the old text.
I reworked things around and tried something else by calling a function.
Now I get this error message:
error: script.lua:39: <eof> expected near 'end'
Here's my code:
Code: Select all
-- load images
background = Image.load ("image.png")
-- create a new Color object
green = Color.new(0, 255, 0)
while true do
screen:blit(0, 0, background, 0, 0, background:width(), background:height(), false)
-- show some text on offscreen
screen:print(200, 100, "Hello World!", green)
end
-- function
function option2()
while true do
screen:blit(0, 0, background, 0, 0, background:width(), background:height(), false)
-- show some text on offscreen
screen:print(200, 100, "Hello World!oneone!", green)
end
-- controls
Pad = Controls.read()
if Pad:cross() or Pad:start() then
screen.waitVblankStart(1)
return "option2"
end
end
-- flip visible and offscreen
screen.flip()
-- wait forevever
screen.waitVblankStart()
end