springroll.AssetManager Class

Module: Core

Handle the asynchronous loading of multiple assets.

Constructor

springroll.AssetManager

()

_onLoaded

(
  • complete
  • load
  • The
)
private

Defined in _onLoaded:203

Handler when a load is finished

Parameters:

destroy

()

Defined in destroy:222

Destroy the AssetManager

getLoad

() springroll.AssetLoad
private

Defined in getLoad:188

Get either a new AssetLoad or a recycled one

Returns:

springroll.AssetLoad:

The load to use

load

(
  • asset
  • [options]
)
springroll.AssetLoad

Defined in load:117

Load a bunch of assets, can only call one load at a time

Parameters:

  • asset Object | Array

    The assets to load

  • [options] Object optional

    The loading options

    • [complete] Function optional

      The callback when finished

    • [progress] Function optional

      The callback when loading percentage is updated

    • [taskDone] Function optional

      The callback when finished with each individual task

    • [autoStart=true] Boolean optional

      If we should start running right away

    • [startAll=true] Boolean optional

      If we should run all the tasks at once, in parallel

    • [cacheAll=false] Boolean optional

      If we should cache all files

    • [type] String optional

      The type of assets to load, defaults to AssetManager.prototype.defaultType

Returns:

springroll.AssetLoad:

The reference to the current load

poolLoad

(
  • load
)
private

Defined in poolLoad:175

Stash the load for use later

Parameters:

register

(
  • TaskClass
  • [priority=0]
)
private

Defined in register:76

Register new tasks types, these tasks must extend Task

Parameters:

  • TaskClass Function | String

    The class task reference

  • [priority=0] Int optional

    The priority. Higher priority tasks are tested first. More general tasks should be lower and more specific tasks should be higher.

cache

springroll.AssetCache

Defined in cache:46

The cache of assets

defaultType

String

Defined in defaultType:61

The default asset type

loadPool

Array private

Defined in loadPool:32

The expired loads to reuse.

loads

Array private

Defined in loads:25

The collection of current multiloads

sizes

springroll.AssetSizes

Defined in sizes:53

Handle multiple asset sizes. Defaults are 'full' at a scale of 1, and 'half' at a scale of 0.5 (under 400 points).

taskDefs

Array

Defined in taskDefs:39

The collection of task definitions