mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 22:18:29 +00:00
Tidying up new Tilemap classes.
This commit is contained in:
parent
d3e460567b
commit
1e181fa30d
4 changed files with 19 additions and 28 deletions
20
README.md
20
README.md
|
@ -40,7 +40,7 @@ Grab the source and join in the fun!
|
|||
|
||||
> In Development
|
||||
|
||||
This is the development branch, where we are building Phaser 2.6.2.
|
||||
This is the development branch, where we are building Phaser 2.7.0.
|
||||
|
||||
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.
|
||||
|
||||
|
@ -107,15 +107,15 @@ Using Browserify? Please [read this](#browserify).
|
|||
|
||||
[jsDelivr](http://www.jsdelivr.com/#!phaser) is a "super-fast CDN for developers". Include the following in your html:
|
||||
|
||||
`<script src="//cdn.jsdelivr.net/phaser/2.6.2/phaser.js"></script>`
|
||||
`<script src="//cdn.jsdelivr.net/phaser/2.7.0/phaser.js"></script>`
|
||||
|
||||
or the minified version:
|
||||
|
||||
`<script src="//cdn.jsdelivr.net/phaser/2.6.2/phaser.min.js"></script>`
|
||||
`<script src="//cdn.jsdelivr.net/phaser/2.7.0/phaser.min.js"></script>`
|
||||
|
||||
[cdnjs.com](https://cdnjs.com/libraries/phaser) also offers a free CDN service. They have all versions of Phaser and even the custom builds:
|
||||
|
||||
`<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.6.2/phaser.js"></script>`
|
||||
`<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.7.0/phaser.js"></script>`
|
||||
|
||||
### Phaser Sandbox
|
||||
|
||||
|
@ -305,11 +305,11 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
|
|||
![Change Log](http://phaser.io/images/github/div-change-log.png "Change Log")
|
||||
<a name="change-log"></a>
|
||||
|
||||
## Version 2.6.2 - "Kore Springs" - In Development
|
||||
## Version 2.7.0 - "Kore Springs" - In Development
|
||||
|
||||
### New Features
|
||||
|
||||
* WebGL Tilemap Renderer.
|
||||
* 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.
|
||||
* Group.getRandomExists will return a random child from the Group that has exists set to true.
|
||||
* 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.
|
||||
* 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.
|
|||
|
||||
[![Analytics](https://ga-beacon.appspot.com/UA-44006568-2/phaser/index)](https://github.com/igrigorik/ga-beacon)
|
||||
|
||||
[get-js]: https://github.com/photonstorm/phaser/releases/download/v2.6.2/phaser.js
|
||||
[get-minjs]: https://github.com/photonstorm/phaser/releases/download/v2.6.2/phaser.min.js
|
||||
[get-zip]: https://github.com/photonstorm/phaser/archive/v2.6.2.zip
|
||||
[get-tgz]: https://github.com/photonstorm/phaser/archive/v2.6.2.tar.gz
|
||||
[get-js]: https://github.com/photonstorm/phaser/releases/download/v2.7.0/phaser.js
|
||||
[get-minjs]: https://github.com/photonstorm/phaser/releases/download/v2.7.0/phaser.min.js
|
||||
[get-zip]: https://github.com/photonstorm/phaser/archive/v2.7.0.zip
|
||||
[get-tgz]: https://github.com/photonstorm/phaser/archive/v2.7.0.tar.gz
|
||||
[clone-http]: https://github.com/photonstorm/phaser.git
|
||||
[clone-ssh]: git@github.com:photonstorm/phaser.git
|
||||
[clone-svn]: https://github.com/photonstorm/phaser
|
||||
|
|
|
@ -601,8 +601,6 @@ Phaser.Tilemap.prototype = {
|
|||
if (height === undefined) { height = this.game.height; }
|
||||
if (group === undefined) { group = this.game.world; }
|
||||
|
||||
console.log("Tilemap.createLayer", layer, width, height);
|
||||
|
||||
var index = layer;
|
||||
|
||||
if (typeof layer === 'string')
|
||||
|
@ -636,15 +634,17 @@ Phaser.Tilemap.prototype = {
|
|||
|
||||
/**
|
||||
* Creates a new internal layer on this Tilemap.
|
||||
*
|
||||
* Internal layers are used when a Tilemap contains multiple Tilesets with different sized tiles. The tilesets
|
||||
* each get a separate layer which is only ever referenced internally by the renderer. This approach permits us
|
||||
* to handle large tiles at screen edges, and with the correct offset relative to the 'base' tileset regardless
|
||||
* of size differences between the tiles.
|
||||
* For WebGl rendering, this approach also permits us to batch the drawing calls efficiently.
|
||||
*
|
||||
* For WebGL rendering, this approach also permits us to batch the drawing calls efficiently.
|
||||
*
|
||||
* By default TilemapLayers are fixed to the camera.
|
||||
*
|
||||
* @method Phaser.Tilemap#createBlankLayer
|
||||
* @method Phaser.Tilemap#createInternalLayer
|
||||
* @param {string} name - The name of this layer. Must be unique within the map.
|
||||
* @param {Phaser.Tileset} tileset - The tileset whose data is to be added to this layer.
|
||||
* @param {number} width - The width of the layer in tiles.
|
||||
|
@ -656,8 +656,6 @@ Phaser.Tilemap.prototype = {
|
|||
*/
|
||||
createInternalLayer: function (name, tileset, width, height, tileWidth, tileHeight, group) {
|
||||
|
||||
console.log("Tilemap.createInternalLayer", name, width, height);
|
||||
|
||||
if (group === undefined) { group = this.game.world; }
|
||||
|
||||
if (this.getLayerIndex(name) !== null)
|
||||
|
@ -763,8 +761,6 @@ Phaser.Tilemap.prototype = {
|
|||
*/
|
||||
createBlankLayer: function (name, width, height, tileWidth, tileHeight, group) {
|
||||
|
||||
console.log("Tilemap.createBlankLayer", name, width, height);
|
||||
|
||||
if (group === undefined) { group = this.game.world; }
|
||||
|
||||
if (this.getLayerIndex(name) !== null)
|
||||
|
|
|
@ -5,14 +5,12 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* A TilemapLayerGL is a PIXI.Tilemap that renders a specific TileLayer of a Tilemap using the PIXI WebGl renderer.
|
||||
* NOTE: this is a close duplicate of Phaser.TilemapLayer modified to support WebGl rendering, it may be possible to merge the two classes
|
||||
* although that will probably incur performance penalties due to some fundamental differences in the set-up before rendering.
|
||||
* 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
|
||||
* extend PIXI.Tilemap, and Phaser.TilemapLayer extends Phaser.DisplayObject. I can't see a way to achieve that merge.
|
||||
*
|
||||
* A TilemapLayerGL is a PIXI.Tilemap that renders a specific TileLayer of a Tilemap using the PIXI WebGL renderer.
|
||||
*
|
||||
* Since a PIXI.Tilemap is a PIXI.DisplayObjectContainer it can be moved around the display, added to other groups or display objects, etc.
|
||||
* NOTE: This is a close duplicate of Phaser.TilemapLayer class, modified to support WebGL rendering, it may be possible to merge the two classes
|
||||
* although that will probably incur performance penalties due to some fundamental differences in the set-up before rendering.
|
||||
*
|
||||
* Since a PIXI.Tilemap is a PIXI.DisplayObjectContainer it can be moved around the display list, added to other groups, or display objects, etc.
|
||||
*
|
||||
* By default TilemapLayers have fixedToCamera set to `true`. Changing this will break Camera follow and scrolling behavior.
|
||||
*
|
||||
|
@ -27,8 +25,6 @@
|
|||
*/
|
||||
Phaser.TilemapLayerGL = function (game, tilemap, index, width, height) {
|
||||
|
||||
console.log( "Phaser.TilemapLayerGL", index, width, height);
|
||||
|
||||
this.game = game;
|
||||
|
||||
width |= 0;
|
||||
|
|
|
@ -35,7 +35,6 @@ Phaser.TilemapParser = {
|
|||
* @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.
|
||||
* @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.
|
||||
* @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.
|
||||
* @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).
|
||||
* @return {object} The parsed map object.
|
||||
*/
|
||||
parse: function (game, key, tileWidth, tileHeight, width, height) {
|
||||
|
|
Loading…
Add table
Reference in a new issue