- Updated `readOnly` doclet to `readonly`
- `array` refined to `type[]`, where such information was immediately
determinable.
- Updated {Any}/{*} to {any}; {...*} is standard exception
- Udated {Object} to {object}
Some cache getters returned nothing on a missing entry (which is evaluated to undefined).
This fixes the issue by making the getters return null, as is the case with other functions in Phaser.Cache.
- In the "Particle Class" demo there was no explicitly-created FrameData which cause issues later on.
This cache updates ensures that FrameData will be automatically created for any added cached bitmap data, unless such is explicitly supplied or forbidden.
- Impact: low
- AnimationManager.loadFrameData is called for all Sprites with BitmapData (except those with an explicit null FrameData) added to the cache
Cache.autoResolveURL is a new boolean (default `false`) that automatically builds a cached map of all loaded assets vs. their absolute URLs, for use with Cache.getURL and Cache.checkURL. Note that in 2.1.3 and earlier this was enabled by default, but has since been moved behind this property which needs to be set to `true` *before* you load any assets to enable.
Cache._resolveUrl has been renamed to Cache._resolveURL internally and gained a new parameter. This method is a private internal one.
Cache.getUrl is deprecated. The same method is now available as Cache.getURL.
XML files weren't being added to the URL map.
Cache._resolveURL was causing a Sound double-load in Firefox and causing errors (thanks @domonyiv #1253)
Cache.getFrameData has a new parameter: `map` which allows you to specify which cache to get the FrameData from, i.e. `Phaser.Cache.IMAGE` or `Phaser.Cache.BITMAPDATA`.
Sprite.loadTexture if given a BitmapData as the texture will now query the cache to see if it has any associated FrameData, and if so it will load that into the AnimationManager.
Cache now has support for XML files stored in their own container. You can add them with `cache.addXML` (typically this is done from the Loader automatically for you) and get them with `cache.getXML(key)`. There is also `cache.checkXMLKey(key)`, `cache.checkKeys` and `cache.removeXML(key)`.
Instead of making a distinction between single frame images and Sprite
Sheets, I added a simple FrameData with one Frame to every image that
gets loaded. This way, a lot of the engine code can be simplified.
For instance, you can play animations on any Sprite without having to
check the “frame count” of its image anymore.
The engine doesn’t have to check for non-existing .frameData anymore.
An animation can keep on playing when an image happens to be set with 1
frame, continuing its animation when after that, another image is set
with multiple frames.
Think of it this way: an image with one frame is an animation of just
one frame.
Sprite.updateCrop is available if you wish to update an externally referenced crop rectangle.
Sprites and Images now have their own textures objects, they are no longer references to those stored in the global Pixi.TextureCache. This allows you to redefine the texture frame dynamically without messing up any other Sprites in your game, such as via cropping. They still share global Base Textures, so image references are kept to a minimum.
Sprite.resetFrame will revert the Sprites texture frame back to its defaults dimensions. This is called when you call Sprite.crop with no rectangle, to reset the crop effect, but can be userful in other situations so we've left it as a public method.
Cache.checkCanvasKey(key) - Check if a Canvas key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkTextureKey(key) - Check if a Texture key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkSoundKey(key) - Check if a Sound key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkTextKey(key) - Check if a Text key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkPhysicsKey(key) - Check if a Physics key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkTilemapKey(key) - Check if a Tilemap key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkBinaryKey(key) - Check if a Binary key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkBitmapDataKey(key) - Check if a BitmapData key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkBitmapFontKey(key) - Check if a BitmapFont key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkJSONKey(key) - Check if a JSON key exists in the cache (thanks to @delta11 for the proposal)