API Docs for: 1.4.0
Show:

Kiwi.Textures.TextureLibrary Class

Module: Textures
Parent Module: Kiwi

Holds a reference to all of the image files (jpg, png, e.t.c) that are accessible on the State this TextureLibrary is on.

Constructor

Kiwi.Textures.TextureLibrary

(
  • game
)
Kiwi.TextureLibrary

Parameters:

  • game Game

    The game that this texture library belongs to.

Returns:

Kiwi.TextureLibrary:

Methods

_buildImage

(
  • imageFile
)
Kiwi.Textures.SingleImage private

Builds a single image atlas from a image file that is provided.

Parameters:

  • imageFile File

    The image file that is to be used.

Returns:

Kiwi.Textures.SingleImage:

The SingleImage that was created.

_buildSpriteSheet

(
  • imageFile
)
Kiwi.Textures.SpriteSheet private

Builds a spritesheet atlas from the an image file that is provided.

Parameters:

  • imageFile Kiwi.File

    The image file that is to be used.

Returns:

Kiwi.Textures.SpriteSheet:

The SpriteSheet that was just created.

_buildTextureAtlas

(
  • imageFile
)
Kiwi.Textures.TextureAtlas private

Used to build a new texture atlas based on the image file provided. Internal use only.

Parameters:

  • imageFile Kiwi.File

    The image file that is to be used.

Returns:

Kiwi.Textures.TextureAtlas:

The new texture atlas that is created.

_rebuildImage

(
  • imageFile
)
Kiwi.File private

Used to rebuild a Texture from the FileStore into a base2 size if it doesn't have it already.

Parameters:

  • imageFile Kiwi.File

    The image file that is to be rebuilt.

Returns:

Kiwi.File:

The new image file.

add

(
  • atlas
)
public

Adds a texture atlas to the library.

Parameters:

addFromFile

(
  • imageFile
)
public

Adds a new image file to the texture library.

Parameters:

  • imageFile Kiwi.File

clear

() public

Resets the texture library.

objType

() String public

The type of object that this is.

Returns:

String:

rebuild

(
  • fileStore
  • state
)
public

Rebuild the library from a fileStore. Clears the library and repopulates it.

Parameters:

Properties

_game

Game private

The game that this texture library is on.

textures

Unknown public

Contains all of the textures that are available.