forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Level Drawing

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
wild8900



Joined: 28 Mar 2007
Posts: 3

PostPosted: Wed Mar 28, 2007 7:27 pm    Post subject: Level Drawing Reply with quote

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
View user's profile Send private message
cools



Joined: 04 Mar 2006
Posts: 46

PostPosted: Wed Apr 18, 2007 12:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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