Level Drawing
Moderators: Shine, Insert_witty_name
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)
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!
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!