| View previous topic :: View next topic |
| Author |
Message |
Koba
Joined: 29 Sep 2005 Posts: 59
|
Posted: Fri Sep 30, 2005 6:49 pm Post subject: screen:print |
|
|
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: | 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 :)) |
|
| Back to top |
|
 |
chaos
Joined: 10 Apr 2005 Posts: 135
|
Posted: Fri Sep 30, 2005 6:54 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Fri Sep 30, 2005 7:31 pm Post subject: |
|
|
| Code: | 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 |
|
| Back to top |
|
 |
Koba
Joined: 29 Sep 2005 Posts: 59
|
Posted: Fri Sep 30, 2005 7:39 pm Post subject: |
|
|
| thanks a bunch guys, you rock! |
|
| Back to top |
|
 |
|