Sorry, no - anim8 has no idea of what's inside the frames. It just knows how and when to draw them.clofresh wrote:I love anim8! Makes animation so much easier.
Question: Is there a way to ask an animation for the bounding box of the non-transparent area of the current frame? It'd like to use it for collision detection where collisions correspond directly to the drawn pixels, but a grid cell is the size of the largest animation frame so many frames have a padding of transparent pixels to make them uniform size. Doesn't have to be the exact shape, a rectangle would do fine.
That said, you can get the current frame (a Quad) like this:
Code: Select all
-- assuming that a is an animation local currentFrame = a.frames[a.position]
But parsing images like that is a slow operation in love. You don't want to be doing that on every frame of animation. I strongly recommend you having that information pre-calculated - manually, or at the beginning of the game - instead. It could slow down your game significantly.