springroll.pixi.TextureTask Class

TextureTask loads an image and sets it up for Pixi to use as a PIXI.Texture.

Constructor

springroll.pixi.TextureTask

(
  • asset.type
  • [asset.image]
  • [asset.color]
  • [asset.alpha]
  • [asset.cache=false]
  • [asset.id]
  • [asset.complete]
  • [asset.sizes=null]
)
private

Parameters:

  • asset.type String

    Must be "pixi" to signify that this asset should be parsed specifically for Pixi.

  • [asset.image] String optional

    The texture image path.

  • [asset.color] String optional

    The color image path, if not using image property.

  • [asset.alpha] String optional

    The alpha image path, if not using image property.

  • [asset.cache=false] Boolean optional

    If we should cache the result - caching results in caching in the global Pixi texture cache as well as Application's asset cache.

  • [asset.id] String optional

    The id of the task.

  • [asset.complete] Function optional

    The callback to call when the load is completed.

  • [asset.sizes=null] Object optional

    Define if certain sizes are not supported

Methods

destroy

()

Defined in destroy:186

Destroy this load task and don't use after this.

loadImage

(
  • assets
  • done
  • [ignoreCacheSetting]
)

Defined in loadImage:90

Load the texture from the properties

Parameters:

  • assets Object

    The assets object to load

  • done Function

    Callback when complete, returns new TextureAtlas

  • [ignoreCacheSetting] Boolean optional

    If the setting to cache results should be ignored because this task is still returning stuff to another task.

start

(
  • callback
)

Defined in start:79

Start the load

Parameters:

  • callback Object

    Callback to call when the load is done

test

(
  • asset
)
Boolean
static

Defined in test:67

Test to see if we should load an asset

Parameters:

  • asset Object

    The asset to test

Returns:

Boolean:

If this qualifies for this task

alpha

String

Defined in alpha:51

The atlas alpha source path

color

String

Defined in color:45

The atlas color source path

image

String

Defined in image:39

The atlas source path

uploadToGPU

Boolean

Defined in uploadToGPU:57

If the texture should be uploaded to the GPU immediately.