CanvasTextureAllocator

class CanvasTextureAllocator extends TextureAllocator

This allocator issues texture backed by a canvas. You can draw on to that canvas to soruce each texture.

Constructor


new CanvasTextureAllocator() → {}

Summary


Methods from CanvasTextureAllocator

TextureSlab
protected createSlab()

Creates a texture slab backed by a canvas.

Properties inherited from TextureAllocator

number
slabHeight

The height of texture slabs.

number
slabWidth

The width of texture slabs.

TextureSlab[]
protected textureSlabs

The list of base-textures that are used to allocate texture space.

Methods inherited from TextureAllocator

T
allocate(width: number, height: number, padding)

Allocates a texture from this allocator.

void
free(texture: T)
T
protected createTexture(baseTexture: PIXI.BaseTexture, frame: PIXI.Rectangle)

Creates a texture on the given base-texture at frame.

T
protected issueTexture(slab: TextureSlab, width: number, height: number, padding: number)

Issues a texture from the given texture slab, if possible.

Protected Methods


createSlab CanvasTextureAllocator.ts:14
protected createSlab() → {TextureSlab}

Creates a texture slab backed by a canvas.

Returns:
Type Description
TextureSlab

Powered by webdoc!