NOTE: content translated by AI.
Bones are connected in a chain. Each bone’s position is determined by its parent bone’s rotation plus its own rotation. The root bone is essentially just a point.
Each joint needs to describe its position on the bone. With HAlign and VAlign attributes, joints can align relative to the image edge rather than absolute origin. This handles images of varying sizes.
Position calculation: BoneMap struct connects to parent bone via From and To properties. From is one of its own joints, To is a joint on the parent bone. Knowing the absolute position of From relative to canvas plus the bone’s rotation angle gives the rotation pivot for rendering. Since From and To share the same absolute position, this recursively resolves up to root.
XML format: project.animations holds multiple animations, animation.frames defines frame sequences. frame.setters>setter elements reset bone rotations at specific frames.
Skin system: projects.skins>skin elements can override bone image paths. Skin and Frame <setter> share the same structure — subject/target/name/content four attributes. Frame can set root position for up-down walking motion; Skin setter can also tweak joint coordinates per image.
DragonBones comparison: Skeleton is a tree structure, but images attach to slots rather than bones directly. Multiple images can hang under one slot, showing only one at a time. Animation export includes rotation, translation, and scale as separate tracks with Bezier curves for easing. A slot object tracks when images swap during animation.
Finally, the codes: bin16/sk2d .