Class TextureAtlas

for slicing textures into tileset

Constructors

Properties

offset: number

get(frame) gets slice of index frame - offset if unsure leave at 0

scaleMode: PIXIScaleMode

scale mode for slices

slices: Texture<TextureSource<any>>[] = []

texture slices

texture: PIXITexture

texture atlas base texture (required in constructor)

tileHeight: number

calculated from cols/rows or passed in constructor

tileWidth: number

calculated from cols/rows or passed in constructor

trim: number

how many pixels not put to slice from each side of frame

Accessors

Methods

  • get lazy cached slice on index

    Parameters

    • frame: number

    Returns Texture<TextureSource<any>>

  • used internally in get(frame) to load the slice first time

    Parameters

    • slice: number

    Returns PIXITexture

  • used internally to preload cached slices

    Parameters

    • count: number = ...

    Returns void