rotate
Turn an entire sprite or a specified layer clockwise by 90, 180, or 270 degrees, optionally applying it only to selected frames.
Instructions
Turn the whole sprite, or one layer, clockwise by 90, 180 or 270 degrees.
Without a layer the canvas turns too (90 and 270 swap width and height) along with every layer in every frame; frames must then cover all frames. With a layer its cels turn about the canvas centre and the canvas keeps its size: on a non-square canvas, content that ends up off the canvas stays in the cel. With ox = floor((w - h) / 2) and oy = floor((h - w) / 2), 90 maps pixel (x, y) to (ox + h - 1 - y, oy + x) and 270 maps it to (y - oy, oy + w - 1 - x): an odd w - h rounds the half pixel of a 90 turn towards the top-left and 270 undoes 90 exactly. A background layer turns by 90/270 only on a square canvas. Slices are not moved. The whole-sprite turn ignores layer locks; a named layer must not be locked.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>",
"angle": "<angle>"
},
"name": "rotate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Sprite file. Relative paths resolve against the server root. | |
| angle | Yes | Degrees clockwise | |
| layer | No | Layer name or 'group/child' path; leave out for every layer | |
| frames | No | Frames: a number, "1-4", "1-4,7" or "all" (1-based) | all |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||