 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
wild8900
Joined: 28 Mar 2007 Posts: 3
|
Posted: Wed Mar 28, 2007 7:27 pm Post subject: Level Drawing |
|
|
| How do you blit images onto a blank jpeg? Or maybe I have it wrong, Im just trieing to find something faster than blitting so many tiles. Are there any better ways? (I made a tile system) |
|
| Back to top |
|
 |
cools
Joined: 04 Mar 2006 Posts: 46
|
Posted: Wed Apr 18, 2007 12:10 pm Post subject: |
|
|
It wouldnt be a blank jpeg. You would need to blit to a blank image.
Pre-render your level (as in blit the tiles to a blank image) and then blit that 1 image to the screen. Update the image as the player moves around the screen, and only that 1 image. It's a great way to create a good tile engine.
to create an empty image called buffer:
buffer = Image.createEmpty(width, height)
then to blit images onto the buffer, use buffer:blit(x,y,etc.). It takes the same parameters as screen:blit() but it will blit it to your buffer before the screen
and then blit the buffer to the screen
while true do
screen:blit()
screen.flip()
screen.waitVblankStart()
end
look at http://wiki.ps2dev.org/psp:lua_player:functions for more info on the lua player funcs and http://lua-users.org/wiki/TutorialDirectory for more info on using lua!
Good Luck! |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|