Slick Forums

Discuss the Slick 2D Library
It is currently Tue May 21, 2013 9:03 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Jul 05, 2012 2:06 pm 
Offline

Joined: Thu Jul 05, 2012 1:42 pm
Posts: 1
Hi guys,

I am new here so let me first say hello!

Second thing: Slick2D is rlly great work! I enjoy using Slick!

Ok then - heres My Problem:

I have got a tga-Image and i want to check a Collision with this Image.

Image

The Figur is black, the light red area is transparent!
I want that for Example the area of the figures head is detected seperatly from for Example the figures lower body.

Uploaded with ImageShack.us

Now they are several Ways to do this in Slick.

1) Creating a Polygon and Check whether the MousePosition is inside
Problem is - it's a lot of work to set up a polygon for every new figur separatly...

2) Check whether the MousePosition is inide the tga-File
Problem is - i want to detect only the visible areas - if I check the MousePosition
depending of the Images Width and Height i will also get "true" if the Mouse stays over
the transparent area.

How would u solve this problem?

much greetings
Magics


Top
 Profile  
 
PostPosted: Fri Jul 06, 2012 4:27 pm 
Offline

Joined: Tue May 22, 2012 8:24 pm
Posts: 49
Pixel Perfect collision maybe ( using getColor(), or getAlpha() )


Top
 Profile  
 
PostPosted: Fri Jul 06, 2012 8:38 pm 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1313
Location: Italy
maybe this can help you

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group