Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / 'sprite hit' using bounding rectangle?...

Author
Message
Foz
16
Years of Service
User Offline
Joined: 18th Dec 2007
Location: California
Posted: 21st Feb 2008 05:12
I was told that 'sprite collision' uses the bounding rectagles of the images in question, and 'sprite hit' uses the actual opaque pixels - but this proved not to be the case. I would love for my cursor to detect only the inside of the concave polygons I'm using in my program - is there a simple way?...


Foz, I am.
Kentaree
21
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 21st Feb 2008 14:14
You're a bit unclear, but what it seems to me is that you're looking for pixel perfect collision, which isn't possible using DBP's built-in commands. I think Freddix made a plugin for sprites which can do pixel perfect collision among other stuff, do a search for freddix + sprite and you'll probably find something.

Foz
16
Years of Service
User Offline
Joined: 18th Dec 2007
Location: California
Posted: 22nd Feb 2008 02:16
Quote: "which isn't possible using DBP's built-in commands."


Thanks, that's probably what I should have asked. I did a little searching for 'freddix', 'ianM', and 'pixel-perfect' and found more questions than answers. It's really only going to be a handful of sprites that will truly benefit from that level of detection, so I'll just write a little algorithm of my own to use once the original collision returns true.


Foz, I am.
Foz
16
Years of Service
User Offline
Joined: 18th Dec 2007
Location: California
Posted: 25th Feb 2008 03:30
I tried it, but it still considered the transparent portion of the target sprite a hit. Do I need to modify my program to make it work? the 2 sprites in question are both PNG's and have backsave and transparency set to the default '1', if that's any help.


Foz, I am.

Login to post a reply

Server time is: 2024-09-27 12:21:29
Your offset time is: 2024-09-27 12:21:29