new TextureSheet(size)textureSheet.js:48Create a texture sheet, called automatically by loadSprite
sizenumber optionalWidth and height of the sheet in pixels
Texture Sheet - A texture that images are packed into as they load Uses shelf packing, images are placed left to right then wrap to a new row
new TextureSheet(size)textureSheet.js:48Create a texture sheet, called automatically by loadSprite
size number optionalWidth and height of the sheet in pixels
canvas : OffscreenCanvastextureSheet.js:61Canvas holding the packed images
context : OffscreenCanvasRenderingContext2DtextureSheet.js:592d context for the canvas
cursor : Vector2textureSheet.js:65Where the next image will be packed
glDirty : booleantextureSheet.js:69Has the canvas changed since the last webgl upload?
rowHeight : numbertextureSheet.js:67Height of the row being packed
size : numbertextureSheet.js:57Width and height of the sheet in pixels
textureInfo : TextureInfotextureSheet.js:63The texture info for this sheet
drawImage(image, tileInfo, update, sourcePadding)textureSheet.js:145Draw an image into this sheet at a tile returned by tryAdd
image HTMLImageElement|HTMLCanvasElement|OffscreenCanvas|ImageBitmapSource image to copy from
tileInfo TileInfoWhere to put it, from tryAdd
update boolean optional, default trueUpload to webgl now, pass false when batching
sourcePadding number|Vector2 optional, default 0How many pixels padding around each frame in the source image
tryAdd(imageSize, frameSize, padding, sourcePadding) → TileInfo|undefinedtextureSheet.js:85Find a spot for an image on this sheet without drawing it
imageSize Vector2Size of the source image in pixels
frameSize Vector2 optionalSize of each frame, or the whole image less its source padding if not passed
padding number optionalHow many pixels padding around each frame
sourcePadding number|Vector2 optional, default 0How many pixels padding around each frame in the source image
Tile for the packed image, or undefined if the sheet is full
updateTexture()textureSheet.js:182Upload the canvas to webgl if it has changed since the last upload Only needed after batching, drawImage uploads automatically by default