You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Commit current state of development before trying something different (see last note in the progress doc). Will revert to previous commits if this attempt fails.
Copy file name to clipboardExpand all lines: docs/_phaser_tilemap_GL_progress.txt
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -150,3 +150,9 @@ Some notes for later:
150
150
151
151
So, I can't create new TilemapLayer objects in TilemapParser because it will preempt Tilemap.createLayer. Or maybe I can, these TilemapLayer objects will be internal (hidden)...? There aren't any later calls in the Examples which I can extend or adapt, so that might have to be the solution.
152
152
153
+
day seven:
154
+
155
+
Read through the above and took a good look at the code. It's a messy solution in this context.
156
+
A better idea... parse the map as previously, on return to Tilemap create layers for each 'unique' entry in tilesets array.
157
+
This avoids the circular calls to and from tilemap and parse, allows map to have a populated data member after parse, and still creates the required new layers before the example calls createLayer.
158
+
(Check if this process can be added to createLayer?)
Copy file name to clipboardExpand all lines: src/tilemap/TilemapParser.js
+25-5Lines changed: 25 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ Phaser.TilemapParser = {
26
26
INSERT_NULL: false,
27
27
28
28
/**
29
-
* Parse tilemap data from the cache and creates a Tilemap object.
29
+
* Parse tilemap data from the cache and creates data for a Tilemap object.
30
30
*
31
31
* @method Phaser.TilemapParser.parse
32
32
* @param {Phaser.Game} game - Game reference to the currently running game.
@@ -35,14 +35,16 @@ Phaser.TilemapParser = {
35
35
* @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.
36
36
* @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.
37
37
* @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).
0 commit comments