Cache#addImage()

addImage(key, url, data) → {object}

Adds an Image file into the Cache. The file must have already been loaded, typically via Phaser.Loader, but can also have been loaded into the DOM.
If an image already exists in the cache with the same key then it is removed and destroyed, and the new image inserted in its place.

Parameters
Name Type Description
key string

The key that this asset will be stored in the cache under. This should be unique within this cache.

url string

The URL the asset was loaded from. If the asset was not loaded externally set to null.

data object

Extra image data.

Returns
object -

The full image object that was added to the cache.

Source code: loader/Cache.js (Line 246)
doc_phaser
2017-02-14 10:39:52
Comments
Leave a Comment

Please login to continue.