Cache#getItem()

getItem(key, cache, method, property) → {object}

Get an item from a cache based on the given key and property.

This method is mostly used internally by other Cache methods such as getImage but is exposed
publicly for your own use as well.

Parameters
Name Type Argument Description
key string

The key of the asset within the cache.

cache integer

The cache to search. One of the Cache consts such as Phaser.Cache.IMAGE or Phaser.Cache.SOUND.

method string <optional>

The string name of the method calling getItem. Can be empty, in which case no console warning is output.

property string <optional>

If you require a specific property from the cache item, specify it here.

Returns
object -

The cached item if found, otherwise null. If the key is invalid and method is set then a console.warn is output.

Source code: loader/Cache.js (Line 1023)
doc_phaser
2017-02-14 10:40:17
Comments
Leave a Comment

Please login to continue.