gfx.sprite.art

gfx.sprite

art(spec) -> sprite

Create a pseudo-pixel-art sprite from a char-map and palette

spec fielddescription
rowsarray of strings, one character per cell
palettemap of character to {r, g, b, a}; other characters are transparent
scalepixels per cell side, default 1
glitch_colorcolour 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.