Skip to content

Commit 1e181fa

Browse files
committed
Tidying up new Tilemap classes.
1 parent d3e4605 commit 1e181fa

4 files changed

Lines changed: 18 additions & 27 deletions

File tree

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Grab the source and join in the fun!
4040

4141
> In Development
4242
43-
This is the development branch, where we are building Phaser 2.6.2.
43+
This is the development branch, where we are building Phaser 2.7.0.
4444

4545
Check the [Change Log](#change-log) to see what we've done so far. Or switch to the master branch for the current stable release.
4646

@@ -107,15 +107,15 @@ Using Browserify? Please [read this](#browserify).
107107

108108
[jsDelivr](http://www.jsdelivr.com/#!phaser) is a "super-fast CDN for developers". Include the following in your html:
109109

110-
`<script src="//cdn.jsdelivr.net/phaser/2.6.2/phaser.js"></script>`
110+
`<script src="//cdn.jsdelivr.net/phaser/2.7.0/phaser.js"></script>`
111111

112112
or the minified version:
113113

114-
`<script src="//cdn.jsdelivr.net/phaser/2.6.2/phaser.min.js"></script>`
114+
`<script src="//cdn.jsdelivr.net/phaser/2.7.0/phaser.min.js"></script>`
115115

116116
[cdnjs.com](https://cdnjs.com/libraries/phaser) also offers a free CDN service. They have all versions of Phaser and even the custom builds:
117117

118-
`<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.6.2/phaser.js"></script>`
118+
`<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.7.0/phaser.js"></script>`
119119

120120
### Phaser Sandbox
121121

@@ -305,11 +305,11 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
305305
![Change Log](http://phaser.io/images/github/div-change-log.png "Change Log")
306306
<a name="change-log"></a>
307307

308-
## Version 2.6.2 - "Kore Springs" - In Development
308+
## Version 2.7.0 - "Kore Springs" - In Development
309309

310310
### New Features
311311

312-
* WebGL Tilemap Renderer.
312+
* The brand new WebGL Tilemap Renderer is available in this release of Phaser. Using custom developed shaders, map parsing and index batching, it finally makes tilemap rendering as fast as it possibly can be in WebGL.
313313
* Group.getRandomExists will return a random child from the Group that has exists set to true.
314314
* Group.getAll will return all children in the Group, or a section of the Group, with the optional ability to test if the child has a property matching the given value or not.
315315
* Group.iterate has a new `returnType`: `RETURN_ALL`. This allows you to return all children that pass the iteration test in an array.
@@ -369,10 +369,10 @@ All rights reserved.
369369

370370
[![Analytics](https://ga-beacon.appspot.com/UA-44006568-2/phaser/index)](https://github.com/igrigorik/ga-beacon)
371371

372-
[get-js]: https://github.com/photonstorm/phaser/releases/download/v2.6.2/phaser.js
373-
[get-minjs]: https://github.com/photonstorm/phaser/releases/download/v2.6.2/phaser.min.js
374-
[get-zip]: https://github.com/photonstorm/phaser/archive/v2.6.2.zip
375-
[get-tgz]: https://github.com/photonstorm/phaser/archive/v2.6.2.tar.gz
372+
[get-js]: https://github.com/photonstorm/phaser/releases/download/v2.7.0/phaser.js
373+
[get-minjs]: https://github.com/photonstorm/phaser/releases/download/v2.7.0/phaser.min.js
374+
[get-zip]: https://github.com/photonstorm/phaser/archive/v2.7.0.zip
375+
[get-tgz]: https://github.com/photonstorm/phaser/archive/v2.7.0.tar.gz
376376
[clone-http]: https://github.com/photonstorm/phaser.git
377377
[clone-ssh]: git@github.com:photonstorm/phaser.git
378378
[clone-svn]: https://github.com/photonstorm/phaser

src/tilemap/Tilemap.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,6 @@ Phaser.Tilemap.prototype = {
601601
if (height === undefined) { height = this.game.height; }
602602
if (group === undefined) { group = this.game.world; }
603603

604-
console.log("Tilemap.createLayer", layer, width, height);
605-
606604
var index = layer;
607605

608606
if (typeof layer === 'string')
@@ -636,15 +634,17 @@ Phaser.Tilemap.prototype = {
636634

637635
/**
638636
* Creates a new internal layer on this Tilemap.
637+
*
639638
* Internal layers are used when a Tilemap contains multiple Tilesets with different sized tiles. The tilesets
640639
* each get a separate layer which is only ever referenced internally by the renderer. This approach permits us
641640
* to handle large tiles at screen edges, and with the correct offset relative to the 'base' tileset regardless
642641
* of size differences between the tiles.
643-
* For WebGl rendering, this approach also permits us to batch the drawing calls efficiently.
642+
*
643+
* For WebGL rendering, this approach also permits us to batch the drawing calls efficiently.
644644
*
645645
* By default TilemapLayers are fixed to the camera.
646646
*
647-
* @method Phaser.Tilemap#createBlankLayer
647+
* @method Phaser.Tilemap#createInternalLayer
648648
* @param {string} name - The name of this layer. Must be unique within the map.
649649
* @param {Phaser.Tileset} tileset - The tileset whose data is to be added to this layer.
650650
* @param {number} width - The width of the layer in tiles.
@@ -656,8 +656,6 @@ Phaser.Tilemap.prototype = {
656656
*/
657657
createInternalLayer: function (name, tileset, width, height, tileWidth, tileHeight, group) {
658658

659-
console.log("Tilemap.createInternalLayer", name, width, height);
660-
661659
if (group === undefined) { group = this.game.world; }
662660

663661
if (this.getLayerIndex(name) !== null)
@@ -763,8 +761,6 @@ Phaser.Tilemap.prototype = {
763761
*/
764762
createBlankLayer: function (name, width, height, tileWidth, tileHeight, group) {
765763

766-
console.log("Tilemap.createBlankLayer", name, width, height);
767-
768764
if (group === undefined) { group = this.game.world; }
769765

770766
if (this.getLayerIndex(name) !== null)

src/tilemap/TilemapLayerGL.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55
*/
66

77
/**
8-
* A TilemapLayerGL is a PIXI.Tilemap that renders a specific TileLayer of a Tilemap using the PIXI WebGl renderer.
9-
* NOTE: this is a close duplicate of Phaser.TilemapLayer modified to support WebGl rendering, it may be possible to merge the two classes
8+
* A TilemapLayerGL is a PIXI.Tilemap that renders a specific TileLayer of a Tilemap using the PIXI WebGL renderer.
9+
*
10+
* NOTE: This is a close duplicate of Phaser.TilemapLayer class, modified to support WebGL rendering, it may be possible to merge the two classes
1011
* although that will probably incur performance penalties due to some fundamental differences in the set-up before rendering.
11-
* Ideally it would be great to make this extend Phaser.TilemapLayer and get access to its methods in that way, however as this needs to
12-
* extend PIXI.Tilemap, and Phaser.TilemapLayer extends Phaser.DisplayObject. I can't see a way to achieve that merge.
13-
*
1412
*
15-
* Since a PIXI.Tilemap is a PIXI.DisplayObjectContainer it can be moved around the display, added to other groups or display objects, etc.
13+
* Since a PIXI.Tilemap is a PIXI.DisplayObjectContainer it can be moved around the display list, added to other groups, or display objects, etc.
1614
*
1715
* By default TilemapLayers have fixedToCamera set to `true`. Changing this will break Camera follow and scrolling behavior.
1816
*
@@ -27,8 +25,6 @@
2725
*/
2826
Phaser.TilemapLayerGL = function (game, tilemap, index, width, height) {
2927

30-
console.log( "Phaser.TilemapLayerGL", index, width, height);
31-
3228
this.game = game;
3329

3430
width |= 0;

src/tilemap/TilemapParser.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ Phaser.TilemapParser = {
3535
* @param {number} [tileHeight=32] - The pixel height of a single map tile. If using CSV data you must specify this. Not required if using Tiled map data.
3636
* @param {number} [width=10] - The width of the map in tiles. If this map is created from Tiled or CSV data you don't need to specify this.
3737
* @param {number} [height=10] - The height of the map in tiles. If this map is created from Tiled or CSV data you don't need to specify this.
38-
* @param {Phaser.Tilemap} [tileMap=null] - The Phaser.Tilemap this data is created for (used for createLayer to add new layers when mixed tilesets are used).
3938
* @return {object} The parsed map object.
4039
*/
4140
parse: function (game, key, tileWidth, tileHeight, width, height) {

0 commit comments

Comments
 (0)