aseprite_draw
Draw geometric primitives, lines, shapes, text, fills, gradients, and dithering onto sprite layers and frames in one ordered batch call.
Instructions
Draw geometric primitives. Pass ops: an array of drawing operations applied in order, all in one call. Coordinates are 0-based from the top-left.
Operations: {op:"pixel", x, y, color} one pixel {op:"line", x1, y1, x2, y2, color} Bresenham line {op:"rect", x, y, w, h, color, filled:false} rectangle (w/h in pixels) {op:"ellipse", cx, cy, rx, ry, color, filled:false} ellipse; rx=ry for a circle {op:"polygon", points:[[x,y],...], color, filled:false} {op:"spline", points:[[x,y],...], color} smooth Catmull-Rom curve (good for tails, hair, limbs) {op:"fill", x, y, color, tolerance:0} flood fill from a seed pixel {op:"clear", x, y, w, h} make a region transparent {op:"gradient", x, y, w, h, from, to, bands:8, direction:"vertical"} banded ramp (classic pixel-art shading) {op:"dither", x, y, w, h, colors:[a,b], matrix:"bayer4", ratio:0.5} ordered dithering {op:"pattern", x, y, w, h, tile:[["#111","."],["#222","#333"]]} repeating 2-D tile {op:"text", text:"Hi", x, y, color, scale:1} built-in 5x7 pixel font
Each op may override layer and frame. Colors accept "#rrggbb", "#rrggbbaa" or a name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ops | Yes | Drawing operations, applied in order. | |
| frame | No | Default target frame for every op. | |
| layer | No | Default target layer for every op. | |
| document | No | Document to act on: a short name inside the art folder ("hero"), a relative path, or an absolute .aseprite path. Omit to use the active document. |