springroll.ColorAlphaTask Class

Extends springroll.Task
Module: Core

Internal class for loading an image that has been split into an alpha channel image and a RGB only color image.

Constructor

springroll.ColorAlphaTask

(
  • asset
)
private

Parameters:

  • asset Object

    The data properties

    • color String

      The source path to the color image

    • alpha String

      The source path to the alpha image

    • [cache=false] Boolean optional

      If we should cache the result

    • [id] String optional

      Id of asset

    • [complete] Function optional

      The event to call when done

    • [sizes=null] Object optional

      Define if certain sizes are not supported

destroy

()

Inherited from springroll.Task: destroy:202

Destroy this and discard

filter

(
  • url
)
protected

Inherited from springroll.Task: filter:151

Add the sizing to each filter

Parameters:

  • url String
    The url to filter

load

(
  • source
  • [options]
)
protected

Inherited from springroll.Task: load:176

Pass-through to the Application load method

Parameters:

mergeAlpha

(
  • rbgImage
  • alphaImage
  • [canvas]
)
Canvas
static

Defined in mergeAlpha:79

Pulled from EaselJS's SpriteSheetUtils. Merges the rgb channels of one image with the alpha channel of another. This can be used to combine a compressed JPEG image containing color data with a PNG32 monochromatic image containing alpha data. With certain types of images (those with detail that lend itself to JPEG compression) this can provide significant file size savings versus a single RGBA PNG32. This method is very fast (generally on the order of 1-2 ms to run).

Parameters:

  • rbgImage Image

    The image (or canvas) containing the RGB channels to use.

  • alphaImage Image

    The image (or canvas) containing the alpha channel to use.

  • [canvas] Canvas optional

    If specified, this canvas will be used and returned. If not, a new canvas will be created.

Returns:

Canvas:

A canvas with the combined image data. This can be used as a source for a Texture.

simpleLoad

(
  • url
  • complete
  • [progress]
  • [data]
)
protected
Pass-through to the Application Loader.load

Parameters:

  • url String
    Path to file to load
  • complete Function
    The callback
  • [progress] Function optional
    The load progress
  • [data] Object optional
    Additiona data

start

(
  • callback
)

Inherited from springroll.Task but overwritten in start:56

Start the task

Parameters:

  • callback Function

    Callback when finished

test

(
  • asset
)
Boolean
static

Defined in test:44

Test if we should run this task

Parameters:

  • asset Object

    The asset to check

Returns:

Boolean:

If the asset is compatible with this asset

alpha

String

Defined in alpha:34

The atlas alpha source path

cache

Boolean

Inherited from springroll.Task: cache:46

If we should cache the load and use later

Default: false

color

String

Defined in color:28

The atlas color source path

complete

Function

Inherited from springroll.Task: complete:37

The user call to fire when completed, returns the arguments result, original, and additionalAssets

Default: null

id

String

Inherited from springroll.Task: id:54

The task id

original

Object

Inherited from springroll.Task: original:66

Reference to the original asset data

status

Int

Inherited from springroll.Task: status:30

The current status of the task (waiting, running, etc)

Default: 0

type

String

Inherited from springroll.Task: type:60

The task type for display filter