S
spritesynthDOCS

Animate with Skeleton

Use skeleton data to drive character animations.

Animate with Skeleton

Animate characters using skeleton rig data. Define joint positions and movements to create precise, controllable animations.

Endpoint

POST /api/animations/animate-with-skeleton

Parameters

NameTypeRequiredDescription
characterstringYesCharacter image URL or base64-encoded image
skeletonobjectYesJSON skeleton data defining joints and poses
animation_typestringYesType of animation: idle, walk, run, attack, hurt, death

Skeleton Data Format

{
  "joints": [
    { "name": "head", "x": 32, "y": 8 },
    { "name": "torso", "x": 32, "y": 20 },
    { "name": "left_arm", "x": 24, "y": 16 },
    { "name": "right_arm", "x": 40, "y": 16 },
    { "name": "left_leg", "x": 28, "y": 36 },
    { "name": "right_leg", "x": 36, "y": 36 }
  ],
  "bones": [
    { "from": "head", "to": "torso" },
    { "from": "torso", "to": "left_arm" },
    { "from": "torso", "to": "right_arm" },
    { "from": "torso", "to": "left_leg" },
    { "from": "torso", "to": "right_leg" }
  ]
}

Example

curl -X POST https://api.spritesynth.com/api/animations/animate-with-skeleton \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "character": "https://example.com/character.png",
    "skeleton": { "joints": [...], "bones": [...] },
    "animation_type": "walk"
  }'

Response

{
  "id": "anim_skel_456",
  "status": "completed",
  "animation": {
    "url": "https://cdn.spritesynth.com/animations/anim_skel_456.gif",
    "sprite_sheet": "https://cdn.spritesynth.com/animations/anim_skel_456_sheet.png",
    "frame_count": 8,
    "frame_width": 64,
    "frame_height": 64,
    "fps": 12
  },
  "credits_cost": 3,
  "duration_ms": 4800
}

Tips

  • Use the Skeleton Editor to visually create skeleton data.
  • Start with idle animations to test skeleton alignment.
  • Joint coordinates are relative to the sprite's top-left corner.

Need help?

Join our Discord community for support and tips.
Was this page helpful?

On this page