Skip to content

Documentation / spryte / tiled

Function: tiled() ​

tiled(draw, frame, x, y, w, h, o?): void

Defined in: panels.ts:82

Fill a w × h box at x, y (top-left) with a frame repeated edge to edge: scrolling backgrounds, floors, water. offsetX/offsetY scroll the pattern. Works on frames inside an atlas (no texture wrapping), one quad per visible tile, on any backend.

ts
import { tiled } from "spryte";
tiled(draw, water, 0, 120, 320, 60, { offsetX: t * 20 });

Parameters ​

draw ​

Draw

frame ​

TextureSource | Frame

x ​

number

y ​

number

w ​

number

h ​

number

o? ​

TiledDrawOptions = NONE

Returns ​

void