ReadonlycolumnsReadonlyframeReadonlyframeReadonlyrowsReadonlytexturegives a frame a name, so game code reads sheet.get('door') rather than sheet.get(6)
names several frames at once, from a plain object of name to index
specific frames, for an animation that holds or ping-pongs
a run of consecutive frames, the usual way an animation is laid out
Cuts an arbitrary rectangle out of the texture, for a sheet that is not a grid: one hand-packed icon, two banner frames, the corners of a nine-patch.
The rectangle is cached under index exactly like a grid frame, so get, region,
name and pick all treat it as a frame and asking for it twice returns the same
Texture rather than cutting a second one. Declaring a rect for an index the grid
also covers replaces that frame, which is what a tightened sub-rect of a cell is:
an item whose art is smaller than its 16 by 16 cell keeps its index and its name.
the texture and frame rectangle together, as plain MWG types rather than pixi.js's
Texture/Rectangle - for a game that needs the geometry, not just the cut texture
StaticfromStaticgridCuts a loaded texture into a grid, numbered left to right then top to bottom, or, with
no frame size, leaves the sheet with no grid for rect to fill in.
the asset path the texture was loaded with
A texture cut into numbered frames.
Nearly every sheet in a tile-based game is a regular grid, so
gridcovers the common case andnamelabels the frames that matter. Frames are cut once and cached: asking for the same index twice returns the same Texture, so sprites sharing a frame also share a texture and stay in one batch.The rest are not grids at all: a hand-packed icon atlas, a strip of bar segments, a nine-patch's corners. Those declare their own rectangles with
rect, and the sheet is built with no frame size, which leaves it with no grid and only the frames declared.