Reference · Looking
pxart scene
Place .px/.png items at x,y (or a text tilemap with --map) on one canvas and render it, optionally in a variant (--variant night) or tinted (--tint).
scene -o s.png [--scale 4] [--size WxH] [--bg #472d3c] [--map M --tile 16x16] [--variant V] [--tint #rrggbbaa] [--dry-run] ITEM@x,y ...
usage: pxart scene [-h] [-o O] [--dry-run] [--scale SCALE] [--bg BG] [--size SIZE] [--map MAP]
[--tile TILE] [--variant VARIANT] [--tint TINT]
[specs ...]
scene -o s.png [--scale 4] [--size WxH] [--bg #472d3c] [--map M --tile 16x16] [--variant V]
[--tint #rrggbbaa] [--dry-run] ITEM@x,y ...
Place .px/.png items at x,y (or a text tilemap with --map) on one canvas and render it,
optionally in a variant (--variant night) or tinted (--tint).
positional arguments:
specs
options:
-h, --help show this help message and exit
-o O
--dry-run print the readout and each output's size and layout, write nothing ('(dry run; nothing written)'); -o may be left off
--scale SCALE
--bg BG
--size SIZE WxH; default 96x64, or the map's size with --map
--map MAP tilemap file: legend lines '<char> <FILE[:frame]>' (rest of line = path), blank line, rows
--tile TILE tile size for --map
--variant VARIANT variant for every map tile and item without its own %variant
--tint TINT '#rrggbbaa' laid over the finished scene (quote it in scripts)
Default --scale 4 (render's: 8).
Size: --size, else the map's, else 96x64 (six 16x16 tiles by four). Pixels past the
edge are cropped, with a note per item (and one for the map) saying how many; at the
default size a note also names the --size that holds every item.
ITEM is FILE[:frame][%variant][+h|+v|+hv]: +h mirrors it left-right, +v top-bottom
(hero.px:walk/0+h@3,4; '+' needs no quoting, where '!' would be history expansion). Map legend entries (which also take +b, see
Placement) and compose layers take +h/+v too. --map draws a text tilemap first:
legend lines '<char> <FILE[:frame][%variant]>', a blank line, then rows of legend
chars ('.' = empty). In a legend line the rest of the line is the path, relative to
the map file: spaces are fine ('b ../png/trees and bushes/bush.png'), "quotes"
optional. A legend entry that can't load is an error at its legend line.
Items are then drawn on top. '#' lines are comments only before the first row;
after that every non-blank line is a row, so '#' works as a map char (a wall row
'####'). Before the rows, a line that is exactly
'# FILE.px[:frame][%variant]' or '# FILE.png' (one token after '#', no spaces) is the
legend line for '#', not a comment, and so is a quoted path ('# "my tiles/wall.png"');
check and scene print a note for it. Any other line starting with '#' is a comment
('# see wall.px' too).
Layers (a tile and a sprite in one cell): a line '---' after the rows starts another
grid of rows over the same legend. Layers draw in order, later over earlier, and '.'
is empty in each; the map is as big as its widest row and tallest layer.
Placement: a map item draws with its top-left at its cell's top-left (column * tile
w, row * tile h), so a 32x32 stall on 16x16 tiles hangs right and down over the next
cells.
A legend entry ending in +b (with flips: +hb, +vb, +hvb) draws bottom-aligned to its
cell and centered across it, odd pixel left: x = cell x + (tile w - w) // 2,
y = cell y + tile h - h. A tall lamp then stands on its cell and rises into the row
above (cut off at the top edge on row 0). +b is for legend entries only.
A worked map, market.map, on 16x16 tiles (tiles.px:cobble, :water/0 and :crate are
16x16, stall.px is 32x32, lamp.px is 16x32):
# ground layer, then props
c tiles.px:cobble
w tiles.px:water/0
x tiles.px:crate+h
S stall.px+b
L lamp.px+b
l lamp.px+hb
cccccc
cccccc
wwwwww
---
......
.S.L.l
x.....
'pxart scene --map market.map -o market.png' is 96x48: cobbles and water, then the
props over them (compose --map builds the same room as a .px). The stall's cell is
16,16, so it draws at 16 + (16-32)//2, 16 + 16 - 32 = 8,0; the lamps at 48,0 and 80,0
(mirrored); the crate, mirrored, at its cell's top-left, 0,32.
--variant V renders every map tile and .px item with V (a whole dark room), except
those with their own %variant, which wins; a .px without V is an E_SELECT error.
%base is the base palette, so 'lamp.px%base@40,20' (or a legend entry 'L lamp.px%base')
stays unrecolored in a --variant night scene (a lit window, a glowing lamp). '%base'
works wherever %variant does, and a variant can't be named base.
Items and legend entries can be PNGs (hero.png@3,4). x,y may be negative (drawn
partly off the left/top edge), in scene and in compose.
--tint '#10183080' lays that color, at its alpha, over the whole finished scene (bg,
map, every item, those with their own %variant too) at 1x, before --scale: a night
scene in one step. To keep a light bright, mask its circle out of the untinted render
and lay that over the tinted one.
See also, in pxart help all: FORMAT: variants (@variant, %VARIANT); FORMAT: paths (what a
path is read from: the current directory, or a file's own); LOOKING: centering (frames of
different sizes, --bg, --dry-run).
pxart help all has the whole reference, pxart help TOPIC one part of it.This is the output of pxart help scene. The other looking commands and their shared notes are in pxart help LOOKING.
This page is built from
site/src/data/reference.json in the repository.Edit on GitHub