pixelkit
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
pixelkit
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->TODO: describe this module.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
on(handle: any, w: number?, ht: number?) → any
Wrap a live pixelArt canvas handle. `w`/`ht` default to Rules.CELL.
| arg | type | description |
|---|---|---|
| handle | any | |
| w | number? | |
| ht | number? |
px(self: any, x: number, y: number, color: string?) → void
| arg | type | description |
|---|---|---|
| self | any | |
| x | number | |
| y | number | |
| color | string? |
rect(self: any, x0: number, y0: number, x1: number, y1: number, color: string?) → void
| arg | type | description |
|---|---|---|
| self | any | |
| x0 | number | |
| y0 | number | |
| x1 | number | |
| y1 | number | |
| color | string? |
blob(self: any, cx: number, cy: number, rx: number, ry: number, color: string?) → void
A filled ellipse — the workhorse for heads, fists, shoulders, pauldrons.
| arg | type | description |
|---|---|---|
| self | any | |
| cx | number | |
| cy | number | |
| rx | number | |
| ry | number | |
| color | string? |
limb(self: any, x0: number, y0: number, x1: number, y1: number, w0: number, w1: number, color: string?) → void
A tapered capsule from (x0,y0) to (x1,y1), width w0 at the start and w1 at the end. This is how every arm, leg, torso and weapon shaft is drawn: the taper is what stops a figure reading as a stack of rectangles.
| arg | type | description |
|---|---|---|
| self | any | |
| x0 | number | |
| y0 | number | |
| x1 | number | |
| y1 | number | |
| w0 | number | |
| w1 | number | |
| color | string? |
line(self: any, x0: number, y0: number, x1: number, y1: number, color: string?, thickness: number?) → void
A straight line, optionally thick.
| arg | type | description |
|---|---|---|
| self | any | |
| x0 | number | |
| y0 | number | |
| x1 | number | |
| y1 | number | |
| color | string? | |
| thickness | number? |
poly(self: any, pts: { { number } }, color: string?) → void
A closed filled polygon (scanline). Points are { {x,y}, ... }.
| arg | type | description |
|---|---|---|
| self | any | |
| pts | { { number } } | |
| color | string? |
ribbon(self: any, pts: { { number } }, w0: number, w1: number, color: string?) → void
A tapering strip through a list of points — scarves, coat tails, hair, the chain on a lantern. Give the points a frame of lag against the body and the ribbon leads and trails the motion on its own.
| arg | type | description |
|---|---|---|
| self | any | |
| pts | { { number } } | |
| w0 | number | |
| w1 | number | |
| color | string? |
speck(self: any, cx: number, cy: number, rx: number, ry: number, color: string?, density: number?) → void
Scattered pixels in an ellipse — grit, sparks, ash, rust, stubble. `density` is 0..1. Deterministic for a given seed so a frame redraws identically.
| arg | type | description |
|---|---|---|
| self | any | |
| cx | number | |
| cy | number | |
| rx | number | |
| ry | number | |
| color | string? | |
| density | number? |
rnd( ) → number
clear(self: any) → void
| arg | type | description |
|---|---|---|
| self | any |
outline(self: any, color: string?) → void
Put a one-pixel rim of `color` around every drawn cluster. Run this LAST. An outline is what makes a sprite read against a busy painted stage; a fighting-game sprite without one disappears into the backdrop.
| arg | type | description |
|---|---|---|
| self | any | |
| color | string? |
shadeLeft(self: any, fromColor: string, shadowColor: string, depth: number?) → void
Darken the left third of every filled column with `shadowColor`, leaving `keepColor` pixels alone. A cheap directional light that gives the figure volume — the stage's key light comes from screen-right in every stage.
| arg | type | description |
|---|---|---|
| self | any | |
| fromColor | string | |
| shadowColor | string | |
| depth | number? |
blend(a: any, b: any, t: number) → any
Linear blend of two pose tables. Numbers interpolate; anything else takes the value from whichever pose is nearer. Nested tables blend recursively.
| arg | type | description |
|---|---|---|
| a | any | |
| b | any | |
| t | number |
linear(t: number) → void
| arg | type | description |
|---|---|---|
| t | number |
inQuad(t: number) → void
| arg | type | description |
|---|---|---|
| t | number |
outQuad(t: number) → void
| arg | type | description |
|---|---|---|
| t | number |
inCubic(t: number) → void
| arg | type | description |
|---|---|---|
| t | number |
outCubic(t: number) → void
| arg | type | description |
|---|---|---|
| t | number |
snap(t: number) → void
| arg | type | description |
|---|---|---|
| t | number |
hold(t: number) → void
| arg | type | description |
|---|---|---|
| t | number |
overshoot(t: number) → void
| arg | type | description |
|---|---|---|
| t | number |
tween(keys: { any }) → void
Build a clip's frames from key poses. keys = { { pose = P1, hold = 2, ease = "outQuad" }, { pose = P2, hold = 4 }, ... } `hold` is how many rendered frames that key occupies before reaching the next one. Returns an array of pose tables, one per frame.
| arg | type | description |
|---|---|---|
| keys | { any } |
follow(chain: { { number } }, ax: number, ay: number, seg: number, lag: number, gravity: number?) → void
Trail a chain of segments behind an anchor point. Feed it the anchor each frame and it relaxes toward it with lag — hair, a scarf, a coat tail, a chain. `chain` is mutated in place and returned, ready for `ribbon`.
| arg | type | description |
|---|---|---|
| chain | { { number } } | |
| ax | number | |
| ay | number | |
| seg | number | |
| lag | number | |
| gravity | number? |
buildSheet(handle: any, clips: { [string]: any }, drawPose: (any, any) → void
Draw a whole sheet from a clip table and hand back the clip index. clips = { idle = { fps = 10, loop = true, poses = {...} }, ... } drawPose(K, pose) renders one frame. Returns { idle = { from = 1, to = 6, fps = 10, loop = true }, ... } — the exact shape the combat slice expects on an art module's `clips` field.
| arg | type | description |
|---|---|---|
| handle | any | |
| clips | { [string]: any } | |
| drawPose | (any, any |
Kit = {Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.