ID:2307703
 
(See the best response by Unwanted4Murder.)
I saw a thread from 2015 discussing this so I was curious if we've gotten anything since then that would help create hit boxes for non-rectangular shapes. I don't think we have. Assuming we haven't, are there any libraries/resources that might get the job done?

Best response
Speaking of hit boxes, I've been meaning to add pixel movement in a project I've been working on, but then realized you have to manually add all the bounding boxes yourself. Is there a way, like in GameMaker, where you can set a bounding box in an editor or a way to automate the process via some clever code?

In response to Ginseng
Nope. You might be able to handroll your own with icon operations, but I wouldn't know the first thing about that.
In response to Ginseng
Ginseng wrote:
Speaking of hit boxes, I've been meaning to add pixel movement in a project I've been working on, but then realized you have to manually add all the bounding boxes yourself. Is there a way, like in GameMaker, where you can set a bounding box in an editor or a way to automate the process via some clever code?
You can use icon.GetPixel() to check for fully transparent pixels, iterating over every pixel of a particular frame (or all frames?) to find the extents (or average them out or whatever).

Bounding boxes for player icons tend to be smaller than the icon itself (especially in non-top-down perspectives) and some things might be bigger than they appear. A simple algorithm won't be applicable to everything, of course.
^ This is what I was thinking, but I didn't have a PC handy to be able to look up the relevant icon proc. :p
In response to Flick
Flick wrote:
You could try this.
http://www.byond.com/developer/Mightymo/DMBox2D

Thanks but I'm not desperate enough to use a "3rd party" binary. Cool though.

Login to reply.