CLI reference › PixelLab utilities
ui
Works on a UI panel PixelLab has already generated, by its PixelLab id: what the
uiAsset generator makes is a template (its id is the lock entry's
objectId). The generator draws the panel; ui turns it into the pieces a
game uses.
pixelkiln ui show --id <ui asset id>
pixelkiln ui split --id <template id>
pixelkiln ui nine-slice --id <element id> --insets 8,8,6,6
pixelkiln ui states --id <template or element id> --state "hover=brighter, a soft glow on the rim" --state "pressed=pushed in: darker, the face one pixel lower"
pixelkiln ui pull --id <template id> --out ui/dialog
ui showprints the asset's kind, size and 9-slice, its elements and their states, and, for a template not split yet, the boxes a split would cut.ui splitcuts a template into one element per shape it was generated from. Free; nothing is generated.--box "label:x,y,width,height"(repeatable, in template pixels) cuts your own boxes instead. A template splits once: to split it differently, delete its elements on PixelLab first. Elements with no label are namedelement 1,element 2by PixelLab.ui nine-slicesets the border insets that stay crisp when a panel or button is stretched:--insets 6for every side or--insets left,right,top,bottom, or--clearto remove them. Free. The insets must leave a middle (left + right below the width, top + bottom below the height), which is checked before anything is sent.ui statesdraws every chosen element in every--state "name=description"in one generation, so a set stays consistent.--idis a split template (every element, or only--element <ids>) or one element. Up to 64 elements and 16 states.--paletteand--max-colorsconstrain the colors. PixelLab prices the grid it lays out: 10 generations up to 256 px on a side, 15 up to 341, 25 above. The command cannot work that grid out in advance, so it prints the three prices, asks before spending (--yesskips,--budgetbelow 25 is refused,--dry-runsends nothing), and prints PixelLab's quote as soon as the job is accepted. One 86x38 element in two states was quoted and billed 10 (November 2026), in about a minute.ui pulldownloads the asset into--out <dir>: the whole image, each element aselements/<name>.png, each state aselements/<name>.<state>.png, andui.json, which records every file's PixelLab id, hash, size, 9-slice insets, and where each element sits in the template. Existing files are replaced only with--force.
A state image is not the same size as its element. The 86x38 button above
came back as an 85x46 hover and an 82x42 pressed state, because a glow or a
shifted face changes the outline. Anchor states by their centre, not their
top-left corner, and read each size from ui.json.
