A bounding box is a polygon that is attached to a bone. Like other attachments, when the bone is transformed, the polygon is also transformed. Bounding boxes can be used at runtime for hit detection, creating physics bodies, spawning particle effects, and more.
The term "bounding box" is somewhat of a misnomer. Technically a bounding box is the smallest rectangle that contains an object. In Spine, bounding boxes are actually arbitrary polygons, though they are often used to define the bounds of the skeleton for hit detection or physics purposes.
To create a new bounding box, select a bone or slot in the tree, then choose
Bounding Box in the properties at the bottom of the tree.
The new bounding box appears in the tree and
Edit mode is automatically selected.
New mode inside of the
Edit mode is also automatically selected.
New mode, clicking in the editor area will create new polygon vertices. Vertices can also be translated by dragging or deleted by double clicking. When the polygon is complete, exit
New mode by clicking the first vertex to close the shape or by clicking the
Edit mode has two tools:
Createallows new vertices to be created along the edges of the polygon by clicking.
Deleteallows vertices or edges to be deleted by clicking.
With either tool, vertices can be translated by dragging or deleted by double clicking. Right click switches tools.
Edit mode can be exited at any time by pressing
escape, by clicking the
Edit button in the properties at the bottom of the tree, or by closing the
Edit Bounding Box dialog.
The bounding box vertices can be edited outside of
Edit mode by using the transform tools. The entire bounding box can be rotated, translated, and scaled like any other attachment.
Individual vertices can be translated with any transform tool by dragging. Multiple vertices can be selected by holding
cmd on Mac), then clicking or dragging to box select. The selected vertices can be deselected by pressing
escape, or by clicking in any empty space.
The origin used for rotation or scaling can be changed. Mouse over the small crosshair at the center of the
Scale tool until a circle appears, then drag the origin to the desired position. The origin will automatically snap to vertices.
Bounding boxes can be automatically deformed when bones are transformed. See Weights for more information.