Guide 1 Docs 2 Reference 3
10

Texture type

A picture drawn in code: game.texture(w, h). Where a texture is taken, a string is a PNG file in the pack instead.

Functions 8

texture:fill(color: Ink)

Paints every pixel one colour.

texture:pixel(x: number, y: number, color: Ink)

Sets one pixel; (0, 0) is the top left.

texture:rect(x: number, y: number, w: number, h: number, color: Ink)

Fills a rectangle of pixels.

texture:frame(x: number, y: number, w: number, h: number, color: Ink)

Draws a box's outline, one pixel wide.

texture:noise(x: number, y: number, w: number, h: number, colors: { Ink }, seed: number?)

Paints each pixel in the area one of the colours at random, as for stone, bark or grain.

texture:sprite(x: number, y: number, rows: { string }, inks: { [string]: Ink }, scale: number?)

Draws pixel art from rows of characters, each character painted with its ink, as on a screen.

texture:draw(other: Texture, x: number?, y: number?)

Draws another texture over this one; its see-through pixels are skipped.

texture:copy() → Texture

Returns a copy to draw on.

Fields 2