screen:print

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
Koba
Posts: 59
Joined: Thu Sep 29, 2005 10:57 am

screen:print

Post by Koba »

k, this one stumped me, i have tryed doing this for about an hour now and can't seem to get it to work... i am making a game and i want to make it so when the cross button is pressed, it deletes a current screen:print on the screen, and replaces it with another screen:print. i have already tryed this:

Code: Select all

if pad:cross() then
   screen.flip()
   screen.waitVblankStart()
   screen:print(x, y, "this text here", color)
end
but that doesn't work... if i could get some help with this that would be great (i'm so very sorry for posting so many questions but this is the easiest way to get help :))
chaos
Posts: 135
Joined: Sun Apr 10, 2005 5:05 pm

Post by chaos »

well, first everthing is backwards.

here is the order you want to do things...

step 1: draw things to the framebuffer (like screen:print)
step 2: wait for vertical sync (waits for screen to be ready)
step 3: then flip the buffer (this step actually shows what you've drawn in step 1)

additionally, make sure "color" is actually a color.
Chaosmachine Studios: High Quality Homebrew.
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

Code: Select all

if pad:cross() then
   screen:clear() --otherwise you overdraw it
   screen:print(x, y, "this text here", color) --put the text out
   screen.flip() --update the screen
end
thats it
lumo
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Koba
Posts: 59
Joined: Thu Sep 29, 2005 10:57 am

Post by Koba »

thanks a bunch guys, you rock!
Post Reply