Module: engine/gfx/utils

Gfx utils.

Source:

Requires

  • module:engine/gfx/core/textures/Texture
  • module:engine/gfx/core/math
  • module:engine/loader

Methods


<static> filmstrip(tilesetp, tileWidth, tileHeight)

Create textures for tiles in a tileset. Can also be used to extract
grid based sprite-sheets.

Parameters:
Name Type Description
tilesetp Texture

Tileset texture.

tileWidth number

Width of a single tile.

tileHeight number

Height of a single tile.

Source:
Returns:

List of textures.

Type
array.<Texture>

<static> textureFromData(data)

Get texture instance from data.

Parameters:
Name Type Description
data String | Array | Texture

Key of the texture.

Source:
Returns:

Texture instance of undefined

Type
Texture | undefined