Skip to content

Commit 0641170

Browse files
committed
Explicitly paused Timer continues if you un-focus and focus the browser window (thanks georgiee)
Added TimerEvent.pendingDelete and checks in Timer.update, so that removing an event in a callback no longer throws an exception (thanks georgiee) Fixed TypeScript defs on lines 1741-1748 (thanks wombatbuddy) Added SAT.js to TypeScript definition. Now compiles properly. Added missing Line.js to the Grunt file. Tilemap#paste diffX and diffY equations changed, fixed issue phaserjs#393 (thanks brejep) Added missing return value in Body.hitLeft and hitRight, fixes issue phaserjs#398 (thanks ram64). Fixed easing tween example case. Issue phaserjs#379 (thanks wesleywerner) Removed SAT.js UMD wrapped, fixes issue phaserjs#361 (thanks luizbills) Removed inContact check from Body.separate. Fixed Tilemap docs (wrongly pointed to Tileset methods)
1 parent d9323de commit 0641170

175 files changed

Lines changed: 6106 additions & 5070 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Bug Fixes:
7979
* Fixed easing tween example case. Issue #379 (thanks wesleywerner)
8080
* Removed SAT.js UMD wrapped, fixes issue #361 (thanks luizbills)
8181
* Removed inContact check from Body.separate.
82+
* Fixed Tilemap docs (wrongly pointed to Tileset methods)
8283

8384

8485
See the full Change Log for all the 1.1.4 updates and API changes (as there were a lot of them!)

build/phaser.js

Lines changed: 64 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
* Phaser - http://www.phaser.io
2020
*
21-
* v1.1.5 - Built at: Wed Feb 12 2014 15:20:51
21+
* v1.1.5 - Built at: Wed Feb 12 2014 15:32:36
2222
*
2323
* By Richard Davey http://www.photonstorm.com @photonstorm
2424
*
@@ -43097,14 +43097,49 @@ Phaser.Tilemap = function (game, key) {
4309743097
return;
4309843098
}
4309943099

43100+
/**
43101+
* @property {number} width - The width of the map (in tiles).
43102+
*/
4310043103
this.width = data.width;
43104+
43105+
/**
43106+
* @property {number} height - The height of the map (in tiles).
43107+
*/
4310143108
this.height = data.height;
43109+
43110+
/**
43111+
* @property {number} tileWidth - The base width of the tiles in the map (in pixels).
43112+
*/
4310243113
this.tileWidth = data.tileWidth;
43114+
43115+
/**
43116+
* @property {number} tileHeight - The base height of the tiles in the map (in pixels).
43117+
*/
4310343118
this.tileHeight = data.tileHeight;
43119+
43120+
/**
43121+
* @property {string} orientation - The orientation of the map data (as specified in Tiled), usually 'orthogonal'.
43122+
*/
4310443123
this.orientation = data.orientation;
43124+
43125+
/**
43126+
* @property {number} version - The version of the map data (as specified in Tiled, usually 1).
43127+
*/
4310543128
this.version = data.version;
43129+
43130+
/**
43131+
* @property {object} properties - Map specific properties as specified in Tiled.
43132+
*/
4310643133
this.properties = data.properties;
43134+
43135+
/**
43136+
* @property {number} widthInPixels - The width of the map in pixels based on width * tileWidth.
43137+
*/
4310743138
this.widthInPixels = data.widthInPixels;
43139+
43140+
/**
43141+
* @property {number} heightInPixels - The height of the map in pixels based on height * tileHeight.
43142+
*/
4310843143
this.heightInPixels = data.heightInPixels;
4310943144

4311043145
/**
@@ -43149,13 +43184,13 @@ Phaser.Tilemap = function (game, key) {
4314943184
this._results = [];
4315043185

4315143186
/**
43152-
* @property {number} _tempA - Internal var.
43187+
* @property {number} _tempA - Internal cache var.
4315343188
* @private
4315443189
*/
4315543190
this._tempA = 0;
4315643191

4315743192
/**
43158-
* @property {number} _tempB - Internal var.
43193+
* @property {number} _tempB - Internal cache var.
4315943194
* @private
4316043195
*/
4316143196
this._tempB = 0;
@@ -43210,7 +43245,7 @@ Phaser.Tilemap.prototype = {
4321043245
format: Phaser.Tilemap.CSV,
4321143246
data: data,
4321243247
indexes: [],
43213-
dirty: true
43248+
dirty: true
4321443249

4321543250
});
4321643251

@@ -43256,20 +43291,21 @@ Phaser.Tilemap.prototype = {
4325643291

4325743292
},
4325843293

43259-
// Region? Remove tile from map data?
43294+
/*
4326043295
createFromTiles: function (layer, tileIndex, key, frame, group) {
4326143296

4326243297
if (typeof group === 'undefined') { group = this.game.world; }
4326343298

4326443299
},
43300+
*/
4326543301

4326643302
/**
4326743303
* Creates a Sprite for every object matching the given gid in the map data. You can optionally specify the group that the Sprite will be created in. If none is
4326843304
* given it will be created in the World. All properties from the map data objectgroup are copied across to the Sprite, so you can use this as an easy way to
4326943305
* configure Sprite properties from within the map editor. For example giving an object a property if alpha: 0.5 in the map editor will duplicate that when the
4327043306
* Sprite is created. You could also give it a value like: body.velocity.x: 100 to set it moving automatically.
4327143307
*
43272-
* @method Phaser.Tileset#createFromObjects
43308+
* @method Phaser.Tilemap#createFromObjects
4327343309
* @param {string} name - The name of the Object Group to create Sprites from.
4327443310
* @param {number} gid - The layer array index value, or if a string is given the layer name, within the map data that this TilemapLayer represents.
4327543311
* @param {string} key - The Game.cache key of the image that this Sprite will use.
@@ -43314,8 +43350,10 @@ Phaser.Tilemap.prototype = {
4331443350

4331543351
/**
4331643352
* Creates a new TilemapLayer object. By default TilemapLayers are fixed to the camera.
43353+
* The `layer` parameter is important. If you've created your map in Tiled then you can get this by looking in Tiled and looking at the Layer name.
43354+
* Or you can open the JSON file it exports and look at the layers[].name value. Either way it must match.
4331743355
*
43318-
* @method Phaser.Tileset#createLayer
43356+
* @method Phaser.Tilemap#createLayer
4331943357
* @param {number|string} layer - The layer array index value, or if a string is given the layer name, within the map data that this TilemapLayer represents.
4332043358
* @param {number} [width] - The rendered width of the layer, should never be wider than Game.width. If not given it will be set to Game.width.
4332143359
* @param {number} [height] - The rendered height of the layer, should never be wider than Game.height. If not given it will be set to Game.height.
@@ -43350,7 +43388,7 @@ Phaser.Tilemap.prototype = {
4335043388
/**
4335143389
* Gets the layer index based on the layers name.
4335243390
*
43353-
* @method Phaser.Tileset#getIndex
43391+
* @method Phaser.Tilemap#getIndex
4335443392
* @protected
4335543393
* @param {array} location - The local array to search.
4335643394
* @param {string} name - The name of the array element to get.
@@ -43373,7 +43411,7 @@ Phaser.Tilemap.prototype = {
4337343411
/**
4337443412
* Gets the layer index based on its name.
4337543413
*
43376-
* @method Phaser.Tileset#getLayerIndex
43414+
* @method Phaser.Tilemap#getLayerIndex
4337743415
* @param {string} name - The name of the layer to get.
4337843416
* @return {number} The index of the layer in this tilemap, or null if not found.
4337943417
*/
@@ -43386,7 +43424,7 @@ Phaser.Tilemap.prototype = {
4338643424
/**
4338743425
* Gets the tileset index based on its name.
4338843426
*
43389-
* @method Phaser.Tileset#getTilesetIndex
43427+
* @method Phaser.Tilemap#getTilesetIndex
4339043428
* @param {string} name - The name of the tileset to get.
4339143429
* @return {number} The index of the tileset in this tilemap, or null if not found.
4339243430
*/
@@ -43399,7 +43437,7 @@ Phaser.Tilemap.prototype = {
4339943437
/**
4340043438
* Gets the image index based on its name.
4340143439
*
43402-
* @method Phaser.Tileset#getImageIndex
43440+
* @method Phaser.Tilemap#getImageIndex
4340343441
* @param {string} name - The name of the image to get.
4340443442
* @return {number} The index of the image in this tilemap, or null if not found.
4340543443
*/
@@ -43412,7 +43450,7 @@ Phaser.Tilemap.prototype = {
4341243450
/**
4341343451
* Gets the object index based on its name.
4341443452
*
43415-
* @method Phaser.Tileset#getObjectIndex
43453+
* @method Phaser.Tilemap#getObjectIndex
4341643454
* @param {string} name - The name of the object to get.
4341743455
* @return {number} The index of the object in this tilemap, or null if not found.
4341843456
*/
@@ -43427,7 +43465,7 @@ Phaser.Tilemap.prototype = {
4342743465
* If a callback is already set for the tile index it will be replaced. Set the callback to null to remove it.
4342843466
* If you want to set a callback for a tile at a specific location on the map then see setTileLocationCallback.
4342943467
*
43430-
* @method Phaser.Tileset#setTileIndexCallback
43468+
* @method Phaser.Tilemap#setTileIndexCallback
4343143469
* @param {number|array} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for.
4343243470
* @param {function} callback - The callback that will be invoked when the tile is collided with.
4343343471
* @param {object} callbackContext - The context under which the callback is called.
@@ -43458,7 +43496,7 @@ Phaser.Tilemap.prototype = {
4345843496
* If a callback is already set for the tile index it will be replaced. Set the callback to null to remove it.
4345943497
* If you want to set a callback for a tile at a specific location on the map then see setTileLocationCallback.
4346043498
*
43461-
* @method Phaser.Tileset#setTileLocationCallback
43499+
* @method Phaser.Tilemap#setTileLocationCallback
4346243500
* @param {number} x - X position of the top left of the area to copy (given in tiles, not pixels)
4346343501
* @param {number} y - Y position of the top left of the area to copy (given in tiles, not pixels)
4346443502
* @param {number} width - The width of the area to copy (given in tiles, not pixels)
@@ -43489,7 +43527,7 @@ Phaser.Tilemap.prototype = {
4348943527
* Sets collision the given tile or tiles. You can pass in either a single numeric index or an array of indexes: [ 2, 3, 15, 20].
4349043528
* The `collides` parameter controls if collision will be enabled (true) or disabled (false).
4349143529
*
43492-
* @method Phaser.Tileset#setCollision
43530+
* @method Phaser.Tilemap#setCollision
4349343531
* @param {number|array} indexes - Either a single tile index, or an array of tile IDs to be checked for collision.
4349443532
* @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.
4349543533
* @param {number|string|Phaser.TilemapLayer} [layer] - The layer to operate on. If not given will default to this.currentLayer.
@@ -43523,7 +43561,7 @@ Phaser.Tilemap.prototype = {
4352343561
* Calling this with a start value of 10 and a stop value of 14 would set collision for tiles 10, 11, 12, 13 and 14.
4352443562
* The `collides` parameter controls if collision will be enabled (true) or disabled (false).
4352543563
*
43526-
* @method Phaser.Tileset#setCollisionBetween
43564+
* @method Phaser.Tilemap#setCollisionBetween
4352743565
* @param {number} start - The first index of the tile to be set for collision.
4352843566
* @param {number} stop - The last index of the tile to be set for collision.
4352943567
* @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.
@@ -43554,7 +43592,7 @@ Phaser.Tilemap.prototype = {
4355443592
* Sets collision on all tiles in the given layer, except for the IDs of those in the given array.
4355543593
* The `collides` parameter controls if collision will be enabled (true) or disabled (false).
4355643594
*
43557-
* @method Phaser.Tileset#setCollisionByExclusion
43595+
* @method Phaser.Tilemap#setCollisionByExclusion
4355843596
* @param {array} indexes - An array of the tile IDs to not be counted for collision.
4355943597
* @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.
4356043598
* @param {number|string|Phaser.TilemapLayer} [layer] - The layer to operate on. If not given will default to this.currentLayer.
@@ -43583,7 +43621,7 @@ Phaser.Tilemap.prototype = {
4358343621
* Sets collision values on a tile in the set.
4358443622
* You shouldn't usually call this method directly, instead use setCollision, setCollisionBetween or setCollisionByExclusion.
4358543623
*
43586-
* @method Phaser.Tileset#setCollisionByIndex
43624+
* @method Phaser.Tilemap#setCollisionByIndex
4358743625
* @protected
4358843626
* @param {number} index - The index of the tile on the layer.
4358943627
* @param {boolean} [collides=true] - If true it will enable collision on the tile. If false it will clear collision values from the tile.
@@ -43626,7 +43664,7 @@ Phaser.Tilemap.prototype = {
4362643664
/**
4362743665
* Gets the TilemapLayer index as used in the setCollision calls.
4362843666
*
43629-
* @method Phaser.Tileset#getLayer
43667+
* @method Phaser.Tilemap#getLayer
4363043668
* @protected
4363143669
* @param {number|string|Phaser.TilemapLayer} layer - The layer to operate on. If not given will default to this.currentLayer.
4363243670
* @return {number} The TilemapLayer index.
@@ -43657,7 +43695,7 @@ Phaser.Tilemap.prototype = {
4365743695
/**
4365843696
* Internal function.
4365943697
*
43660-
* @method Phaser.Tileset#calculateFaces
43698+
* @method Phaser.Tilemap#calculateFaces
4366143699
* @protected
4366243700
* @param {number} layer - The index of the TilemapLayer to operate on.
4366343701
*/
@@ -43714,7 +43752,7 @@ Phaser.Tilemap.prototype = {
4371443752
* Gets the tile above the tile coordinates given.
4371543753
* Mostly used as an internal function by calculateFaces.
4371643754
*
43717-
* @method Phaser.Tileset#getTileAbove
43755+
* @method Phaser.Tilemap#getTileAbove
4371843756
* @param {number} layer - The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
4371943757
* @param {number} x - The x coordinate to get the tile from. In tiles, not pixels.
4372043758
* @param {number} y - The y coordinate to get the tile from. In tiles, not pixels.
@@ -43734,7 +43772,7 @@ Phaser.Tilemap.prototype = {
4373443772
* Gets the tile below the tile coordinates given.
4373543773
* Mostly used as an internal function by calculateFaces.
4373643774
*
43737-
* @method Phaser.Tileset#getTileBelow
43775+
* @method Phaser.Tilemap#getTileBelow
4373843776
* @param {number} layer - The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
4373943777
* @param {number} x - The x coordinate to get the tile from. In tiles, not pixels.
4374043778
* @param {number} y - The y coordinate to get the tile from. In tiles, not pixels.
@@ -43754,7 +43792,7 @@ Phaser.Tilemap.prototype = {
4375443792
* Gets the tile to the left of the tile coordinates given.
4375543793
* Mostly used as an internal function by calculateFaces.
4375643794
*
43757-
* @method Phaser.Tileset#getTileLeft
43795+
* @method Phaser.Tilemap#getTileLeft
4375843796
* @param {number} layer - The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
4375943797
* @param {number} x - The x coordinate to get the tile from. In tiles, not pixels.
4376043798
* @param {number} y - The y coordinate to get the tile from. In tiles, not pixels.
@@ -43774,7 +43812,7 @@ Phaser.Tilemap.prototype = {
4377443812
* Gets the tile to the right of the tile coordinates given.
4377543813
* Mostly used as an internal function by calculateFaces.
4377643814
*
43777-
* @method Phaser.Tileset#getTileRight
43815+
* @method Phaser.Tilemap#getTileRight
4377843816
* @param {number} layer - The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
4377943817
* @param {number} x - The x coordinate to get the tile from. In tiles, not pixels.
4378043818
* @param {number} y - The y coordinate to get the tile from. In tiles, not pixels.
@@ -43831,7 +43869,7 @@ Phaser.Tilemap.prototype = {
4383143869
this.layers[layer].data[y][x].index = tile;
4383243870
}
4383343871

43834-
this.layers[layer].dirty = true;
43872+
this.layers[layer].dirty = true;
4383543873
this.calculateFaces(layer);
4383643874
}
4383743875

@@ -43991,7 +44029,7 @@ Phaser.Tilemap.prototype = {
4399144029
this.layers[layer].data[ diffY + tileblock[i].y ][ diffX + tileblock[i].x ].copy(tileblock[i]);
4399244030
}
4399344031

43994-
this.layers[layer].dirty = true;
44032+
this.layers[layer].dirty = true;
4399544033
this.calculateFaces(layer);
4399644034

4399744035
},

build/phaser.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/Animation.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
923923

924924
<span class="jsdoc-message">
925925
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
926-
on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
926+
on Wed Feb 12 2014 15:32:11 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
927927
</span>
928928
</footer>
929929
</div>

docs/AnimationManager.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ <h1 class="page-title">Source: animation/AnimationManager.js</h1>
879879

880880
<span class="jsdoc-message">
881881
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
882-
on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
882+
on Wed Feb 12 2014 15:32:11 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
883883
</span>
884884
</footer>
885885
</div>

docs/AnimationParser.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ <h1 class="page-title">Source: animation/AnimationParser.js</h1>
777777

778778
<span class="jsdoc-message">
779779
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
780-
on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
780+
on Wed Feb 12 2014 15:32:11 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
781781
</span>
782782
</footer>
783783
</div>

docs/ArcadePhysics.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1881,7 +1881,7 @@ <h1 class="page-title">Source: physics/arcade/ArcadePhysics.js</h1>
18811881

18821882
<span class="jsdoc-message">
18831883
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
1884-
on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
1884+
on Wed Feb 12 2014 15:32:11 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
18851885
</span>
18861886
</footer>
18871887
</div>

docs/BitmapData.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,7 @@ <h1 class="page-title">Source: gameobjects/BitmapData.js</h1>
15701570

15711571
<span class="jsdoc-message">
15721572
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
1573-
on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
1573+
on Wed Feb 12 2014 15:32:11 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
15741574
</span>
15751575
</footer>
15761576
</div>

docs/BitmapText.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ <h1 class="page-title">Source: gameobjects/BitmapText.js</h1>
683683

684684
<span class="jsdoc-message">
685685
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
686-
on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
686+
on Wed Feb 12 2014 15:32:11 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
687687
</span>
688688
</footer>
689689
</div>

docs/Body.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1991,7 +1991,7 @@ <h1 class="page-title">Source: physics/arcade/Body.js</h1>
19911991

19921992
<span class="jsdoc-message">
19931993
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
1994-
on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
1994+
on Wed Feb 12 2014 15:32:11 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
19951995
</span>
19961996
</footer>
19971997
</div>

0 commit comments

Comments
 (0)