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 

help w/ Image transparency & object Collision

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



Joined: 17 May 2006
Posts: 2

PostPosted: Wed May 17, 2006 3:23 am    Post subject: help w/ Image transparency & object Collision Reply with quote

I am new to programming and my first game I am working on is a side scrolling game and I am trying to remove the white box that forms around the images that I blit into my game. What do i need to do to make the white box transparent.

Also I am having a hard time making collisions with objects. I can get my player to jump and he will land on the object but when he walks off the object the player.gravity is a adjusted to the object.y and he doesn't return to the ground. All the expressions I have tried either stops the player from jumping or just doesn't return him to ground level once on the object. Any help will be greatly appreciated.
Back to top
View user's profile Send private message AIM Address
JorDy



Joined: 11 Dec 2005
Posts: 121

PostPosted: Wed May 17, 2006 4:13 am    Post subject: Reply with quote

well for transparency use the Alpha channels (R-G-B-Alpha) so when blitting an image it should be:
image:blit(x, y, Image source, [sourcex, sourcey, width, height], true)
the true at the end is enabling the alpha channel
for transparent colours use Color.new(r, g, b, a) the max is 255 for all R-G-B-A
as for gravity im not sure, best way for collision is to use a collision map check PSPGolf for that
Back to top
View user's profile Send private message
Marman57



Joined: 17 May 2006
Posts: 2

PostPosted: Wed May 17, 2006 8:13 am    Post subject: Reply with quote

I am not exactly sure on how to set this up. Can you please elaborate on what you mean by

"for transparent colours use Color.new(r, g, b, a)"

I did set the alpha channel to true in my image:blit(....) but nothing changed. Do i need to do anything to the actual image in Windows paint or other image editing program. Thank you.
Back to top
View user's profile Send private message AIM Address
shifty_bill



Joined: 07 Jan 2006
Posts: 8

PostPosted: Wed May 17, 2006 10:42 am    Post subject: Reply with quote

i use photoshop CS2 to make my images transparent

start with the magic wand selector, select the background,
ctrl + shift + i = invert selection
then
ctrl + x (cut)
ctrl + v (paste)
then delete the background layer

and there we go a transparent image
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