Skip to content

Commit bcedd92

Browse files
committed
Cache.addSpriteSheet didn't include default values for the frameMax, margin and spacing arguments (thanks @vladkens phaserjs#2017 phaserjs#2018)
1 parent 845a14f commit bcedd92

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ If you'd like to try coding in Phaser right now, with nothing more than your web
121121

122122
### Koding
123123

124-
Want to try Phaser without downloading anything? [Clone Phaser in Koding](https://koding.com/Teamwork?import=https://github.com/photonstorm/phaser/archive/master.zip&c=git1) and start working right away in their web based development system.
124+
Want to try Phaser without downloading anything? The site [Koding](https://koding.com) offer a complete browser-based virtual machine to work in, allowing you to clone the Phaser repo and start work immediately.
125125

126126
### License
127127

@@ -306,6 +306,7 @@ If you are an exceptional JavaScript developer and would like to join the Phaser
306306
* Video.stop now removes the 'playing' event listener, which stop Videos set to loop from throwing errors after being destroyed.
307307
* Tilemap.createFromObjects has been strengthened so that will only create Sprites for matching gids/ids/names. It also only sets the Sprite width and height values if they are present in the Tiled data (thanks @pparke #2012)
308308
* TilingSprite._renderCanvas wasn't correctly allowing for pixel rounding (thanks @ximop #2022)
309+
* Cache.addSpriteSheet didn't include default values for the `frameMax`, `margin` and `spacing` arguments (thanks @vladkens #2017 #2018)
309310

310311
For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md).
311312

src/loader/Cache.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,10 @@ Phaser.Cache.prototype = {
559559
*/
560560
addSpriteSheet: function (key, url, data, frameWidth, frameHeight, frameMax, margin, spacing) {
561561

562+
if (frameMax === undefined) { frameMax = -1; }
563+
if (margin === undefined) { margin = 0; }
564+
if (spacing === undefined) { spacing = 0; }
565+
562566
var obj = {
563567
key: key,
564568
url: url,

0 commit comments

Comments
 (0)