art(
spec) ->sprite
Create a pseudo-pixel-art sprite from a char-map and palette
| spec field | description |
|---|---|
rows | array of strings, one character per cell |
palette | map of character to {r, g, b, a}; other characters are transparent |
scale | pixels per cell side, default 1 |
glitch_color | colour of a cell glitch turns on; default the first palette entry |
The art is drawn once into its own surface. The result blits, flips and
tints like any sprite. Art drawn in white recolours at blit time through
tint.
art:glitch(prob, color) returns a new art sprite with each cell turned on
or off at random, with probability prob (default 0.15). A cell turned on
takes color, default glitch_color.