Home Reference Source
public class | source

TextureAtlas

Dynamic texture atlas for performant support of systems with multiple emitters and textures.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public

canvas: *

public

entries: *[]

public
public
public
public

Method Summary

Public Methods
public

addTexture(texture: *)

Adds a texture to the texture atlas and flags that the atlas needs to be updated.

public

debug()

Debugs the texture atlas by rendering it to a canvas in the DOM.

public

destroy(): *

Disposes of the textures used by the texture atlas.

public

log(args: ...*)

Logs to the console when in dev mode.

public

update()

Updates the texture atlas.

Public Constructors

public constructor() source

Public Members

public atlasIndex: * source

public atlasTexture: * source

public canvas: * source

public entries: *[] source

public indexData: * source

public needsUpdate: boolean source

public rendererType: * source

public shouldDebug: * source

Public Methods

public addTexture(texture: *) source

Adds a texture to the texture atlas and flags that the atlas needs to be updated.

Params:

NameTypeAttributeDescription
texture *

public debug() source

Debugs the texture atlas by rendering it to a canvas in the DOM.

public destroy(): * source

Disposes of the textures used by the texture atlas.

Return:

*

void

public log(args: ...*) source

Logs to the console when in dev mode.

Params:

NameTypeAttributeDescription
args ...*

public update() source

Updates the texture atlas. Will only rebuild the atlas if all images are loaded.