66
77/**
88* Phaser has one single cache in which it stores all assets.
9- *
9+ *
1010* The cache is split up into sections, such as images, sounds, video, json, etc. All assets are stored using
1111* a unique string-based key as their identifier. Assets stored in different areas of the cache can have the
1212* same key, for example 'playerWalking' could be used as the key for both a sprite sheet and an audio file,
1313* because they are unique data types.
14- *
14+ *
1515* The cache is automatically populated by the Phaser.Loader. When you use the loader to pull in external assets
1616* such as images they are automatically placed into their respective cache. Most common Game Objects, such as
1717* Sprites and Videos automatically query the cache to extract the assets they need on instantiation.
@@ -604,13 +604,10 @@ Phaser.Cache.prototype = {
604604 {
605605 obj . frameData = Phaser . AnimationParser . XMLData ( this . game , atlasData , key ) ;
606606 }
607- < << << << HEAD
608- = === ===
609607 else if ( format === Phaser . Loader . TEXTURE_ATLAS_JSON_PYXEL )
610608 {
611609 obj . frameData = Phaser . AnimationParser . JSONDataPyxel ( this . game , atlasData , key ) ;
612610 }
613- > >>> >>> 247064 f ... fixed some typos and explicitly setTrim to false
614611 else
615612 {
616613 // Let's just work it out from the frames array
@@ -993,7 +990,7 @@ Phaser.Cache.prototype = {
993990
994991 /**
995992 * Get an item from a cache based on the given key and property.
996- *
993+ *
997994 * This method is mostly used internally by other Cache methods such as `getImage` but is exposed
998995 * publicly for your own use as well.
999996 *
@@ -1024,16 +1021,16 @@ Phaser.Cache.prototype = {
10241021 return this . _cacheMap [ cache ] [ key ] [ property ] ;
10251022 }
10261023 }
1027-
1024+
10281025 return null ;
10291026
10301027 } ,
10311028
10321029 /**
10331030 * Gets a Canvas object from the cache.
1034- *
1031+ *
10351032 * The object is looked-up based on the key given.
1036- *
1033+ *
10371034 * Note: If the object cannot be found a `console.warn` message is displayed.
10381035 *
10391036 * @method Phaser.Cache#getCanvas
@@ -1048,13 +1045,13 @@ Phaser.Cache.prototype = {
10481045
10491046 /**
10501047 * Gets a Image object from the cache. This returns a DOM Image object, not a Phaser.Image object.
1051- *
1048+ *
10521049 * The object is looked-up based on the key given.
1053- *
1050+ *
10541051 * Note: If the object cannot be found a `console.warn` message is displayed.
1055- *
1052+ *
10561053 * Only the Image cache is searched, which covers images loaded via Loader.image, Sprite Sheets and Texture Atlases.
1057- *
1054+ *
10581055 * If you need the image used by a bitmap font or similar then please use those respective 'get' methods.
10591056 *
10601057 * @method Phaser.Cache#getImage
@@ -1091,7 +1088,7 @@ Phaser.Cache.prototype = {
10911088
10921089 /**
10931090 * Get a single texture frame by key.
1094- *
1091+ *
10951092 * You'd only do this to get the default Frame created for a non-atlas / spritesheet image.
10961093 *
10971094 * @method Phaser.Cache#getTextureFrame
@@ -1106,9 +1103,9 @@ Phaser.Cache.prototype = {
11061103
11071104 /**
11081105 * Gets a Phaser.Sound object from the cache.
1109- *
1106+ *
11101107 * The object is looked-up based on the key given.
1111- *
1108+ *
11121109 * Note: If the object cannot be found a `console.warn` message is displayed.
11131110 *
11141111 * @method Phaser.Cache#getSound
@@ -1123,9 +1120,9 @@ Phaser.Cache.prototype = {
11231120
11241121 /**
11251122 * Gets a raw Sound data object from the cache.
1126- *
1123+ *
11271124 * The object is looked-up based on the key given.
1128- *
1125+ *
11291126 * Note: If the object cannot be found a `console.warn` message is displayed.
11301127 *
11311128 * @method Phaser.Cache#getSoundData
@@ -1140,9 +1137,9 @@ Phaser.Cache.prototype = {
11401137
11411138 /**
11421139 * Gets a Text object from the cache.
1143- *
1140+ *
11441141 * The object is looked-up based on the key given.
1145- *
1142+ *
11461143 * Note: If the object cannot be found a `console.warn` message is displayed.
11471144 *
11481145 * @method Phaser.Cache#getText
@@ -1157,11 +1154,11 @@ Phaser.Cache.prototype = {
11571154
11581155 /**
11591156 * Gets a Physics Data object from the cache.
1160- *
1157+ *
11611158 * The object is looked-up based on the key given.
1162- *
1159+ *
11631160 * Note: If the object cannot be found a `console.warn` message is displayed.
1164- *
1161+ *
11651162 * You can get either the entire data set, a single object or a single fixture of an object from it.
11661163 *
11671164 * @method Phaser.Cache#getPhysicsData
@@ -1219,9 +1216,9 @@ Phaser.Cache.prototype = {
12191216
12201217 /**
12211218 * Gets a raw Tilemap data object from the cache. This will be in either CSV or JSON format.
1222- *
1219+ *
12231220 * The object is looked-up based on the key given.
1224- *
1221+ *
12251222 * Note: If the object cannot be found a `console.warn` message is displayed.
12261223 *
12271224 * @method Phaser.Cache#getTilemapData
@@ -1236,9 +1233,9 @@ Phaser.Cache.prototype = {
12361233
12371234 /**
12381235 * Gets a binary object from the cache.
1239- *
1236+ *
12401237 * The object is looked-up based on the key given.
1241- *
1238+ *
12421239 * Note: If the object cannot be found a `console.warn` message is displayed.
12431240 *
12441241 * @method Phaser.Cache#getBinary
@@ -1253,9 +1250,9 @@ Phaser.Cache.prototype = {
12531250
12541251 /**
12551252 * Gets a BitmapData object from the cache.
1256- *
1253+ *
12571254 * The object is looked-up based on the key given.
1258- *
1255+ *
12591256 * Note: If the object cannot be found a `console.warn` message is displayed.
12601257 *
12611258 * @method Phaser.Cache#getBitmapData
@@ -1270,9 +1267,9 @@ Phaser.Cache.prototype = {
12701267
12711268 /**
12721269 * Gets a Bitmap Font object from the cache.
1273- *
1270+ *
12741271 * The object is looked-up based on the key given.
1275- *
1272+ *
12761273 * Note: If the object cannot be found a `console.warn` message is displayed.
12771274 *
12781275 * @method Phaser.Cache#getBitmapFont
@@ -1287,11 +1284,11 @@ Phaser.Cache.prototype = {
12871284
12881285 /**
12891286 * Gets a JSON object from the cache.
1290- *
1287+ *
12911288 * The object is looked-up based on the key given.
1292- *
1289+ *
12931290 * Note: If the object cannot be found a `console.warn` message is displayed.
1294- *
1291+ *
12951292 * You can either return the object by reference (the default), or return a clone
12961293 * of it by setting the `clone` argument to `true`.
12971294 *
@@ -1324,9 +1321,9 @@ Phaser.Cache.prototype = {
13241321
13251322 /**
13261323 * Gets an XML object from the cache.
1327- *
1324+ *
13281325 * The object is looked-up based on the key given.
1329- *
1326+ *
13301327 * Note: If the object cannot be found a `console.warn` message is displayed.
13311328 *
13321329 * @method Phaser.Cache#getXML
@@ -1341,9 +1338,9 @@ Phaser.Cache.prototype = {
13411338
13421339 /**
13431340 * Gets a Phaser.Video object from the cache.
1344- *
1341+ *
13451342 * The object is looked-up based on the key given.
1346- *
1343+ *
13471344 * Note: If the object cannot be found a `console.warn` message is displayed.
13481345 *
13491346 * @method Phaser.Cache#getVideo
@@ -1358,9 +1355,9 @@ Phaser.Cache.prototype = {
13581355
13591356 /**
13601357 * Gets a fragment shader object from the cache.
1361- *
1358+ *
13621359 * The object is looked-up based on the key given.
1363- *
1360+ *
13641361 * Note: If the object cannot be found a `console.warn` message is displayed.
13651362 *
13661363 * @method Phaser.Cache#getShader
@@ -1375,9 +1372,9 @@ Phaser.Cache.prototype = {
13751372
13761373 /**
13771374 * Gets a RenderTexture object from the cache.
1378- *
1375+ *
13791376 * The object is looked-up based on the key given.
1380- *
1377+ *
13811378 * Note: If the object cannot be found a `console.warn` message is displayed.
13821379 *
13831380 * @method Phaser.Cache#getRenderTexture
@@ -1451,9 +1448,9 @@ Phaser.Cache.prototype = {
14511448
14521449 /**
14531450 * Gets a Phaser.FrameData object from the Image Cache.
1454- *
1451+ *
14551452 * The object is looked-up based on the key given.
1456- *
1453+ *
14571454 * Note: If the object cannot be found a `console.warn` message is displayed.
14581455 *
14591456 * @method Phaser.Cache#getFrameData
@@ -1587,7 +1584,7 @@ Phaser.Cache.prototype = {
15871584
15881585 /**
15891586 * Gets a PIXI.BaseTexture by key from the PIXI.BaseTextureCache.
1590- *
1587+ *
15911588 * If the texture isn't found in the cache, then it searches the Phaser Image Cache.
15921589 *
15931590 * @method Phaser.Cache#getPixiBaseTexture
@@ -1691,7 +1688,7 @@ Phaser.Cache.prototype = {
16911688
16921689 /**
16931690 * Removes an image from the cache.
1694- *
1691+ *
16951692 * You can optionally elect to destroy it as well. This calls BaseTexture.destroy on it.
16961693 *
16971694 * Note that this only removes it from the Phaser and PIXI Caches. If you still have references to the data elsewhere
0 commit comments