loodakrawa / SpriterDotNet

A pure C# Spriter implementation
zlib License
220 stars 75 forks source link

Total bounding area #104

Closed Mathetis closed 5 years ago

Mathetis commented 5 years ago

Hey, is there an easy way to find the total maximum bounding area of an animation? Or all animations for a sprite instance?

Thanks for any assistance.

loodakrawa commented 5 years ago

Hi,

The easiest way I can think of is - running the simulation once after loading (with a small time delta) and using GetBoundingBox on all the sprites in each frame. The max bounding box for an animation is the union of all the bounding boxes of all sprites across all frames.

Hope this helps.

Mathetis commented 5 years ago

It does, thank you.