AtlasAllocator

class AtlasAllocator extends TextureAllocator

This texture allocator auto-manages the base-texture with an AtlasResource. You can also pass a texture source to allocate, mimicing Texture.from functionality.

Constructor


new AtlasAllocator() → {}

Summary


Methods from AtlasAllocator

PIXI.Texture
allocate(width: number, height: number, padding: number | AtlasResourceSource, source: AtlasResourceSource)

Allocates a texture backed by the given atlas source, with the given padding.

PIXI.Texture
allocate(width: number, height: number, source: AtlasResourceSource)

Allocates a texture backed by the given source, with default padding.

TextureSlab
protected createSlab()

Creates a texture slab backed by an AtlasResource.

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

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.

Public Methods


allocate AtlasAllocator.ts:33
allocate(width: number, height: number, padding: number | AtlasResourceSource, source: AtlasResourceSource) → {PIXI.Texture}

Allocates a texture backed by the given atlas source, with the given padding.

Parameters:
Name Type Attributes Description
width number
height number
padding number | AtlasResourceSource

<optional>

source AtlasResourceSource

<optional>

Returns:
Type Description
PIXI.Texture
allocate AtlasAllocator.ts:44
allocate(width: number, height: number, source: AtlasResourceSource) → {PIXI.Texture}

Allocates a texture backed by the given source, with default padding.

Parameters:
Name Type Attributes Description
width number
height number
source AtlasResourceSource

<optional>

Returns:
Type Description
PIXI.Texture

Protected Methods


createSlab AtlasAllocator.ts:17
protected createSlab() → {TextureSlab}

Creates a texture slab backed by an AtlasResource.

Returns:
Type Description
TextureSlab

Powered by webdoc!