Shaku

Shaku JS

Back To Table of Content

Texture Atlas Asset

Classes

TextureAtlasAsset

A texture atlas we can build at runtime to combine together multiple textures.

Functions

loadAllSources()

Convert list of sources that are either Image instances or URL strings to fully loaded Image instances. Wait for image loading if needed.

TextureAtlasAsset

A texture atlas we can build at runtime to combine together multiple textures.

Kind: global class

textureAtlasAsset.textures ⇒ Array.<TextureAsset>

Get a list with all textures in atlas.

Kind: instance property of TextureAtlasAsset
Returns: Array.<TextureAsset> - Textures in atlas.

textureAtlasAsset.valid

Kind: instance property of TextureAtlasAsset

textureAtlasAsset.getTexture(url) ⇒ TextureInAtlasAsset

Get texture asset and source rectangle for a desired image URL.

Kind: instance method of TextureAtlasAsset
Returns: TextureInAtlasAsset - Texture in atlas asset, or null if not found.

Param Type Description
url String URL to fetch texture and source from. Can be full URL, relative URL, or absolute URL starting from /.

textureAtlasAsset.destroy()

Kind: instance method of TextureAtlasAsset

loadAllSources()

Convert list of sources that are either Image instances or URL strings to fully loaded Image instances. Wait for image loading if needed.

Kind: global function