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
Copy file name to clipboardExpand all lines: src/tilemaps/Tilemap.js
+75-2Lines changed: 75 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -122,6 +122,24 @@ var Tilemap = new Class({
122
122
*/
123
123
this.orientation=mapData.orientation;
124
124
125
+
/**
126
+
* The render (draw) order of the map data (as specified in Tiled), usually 'right-down'.
127
+
*
128
+
* The draw orders are:
129
+
*
130
+
* right-down
131
+
* left-down
132
+
* right-up
133
+
* left-up
134
+
*
135
+
* This can be changed via the `setRenderOrder` method.
136
+
*
137
+
* @name Phaser.Tilemaps.Tilemap#renderOrder
138
+
* @type {string}
139
+
* @since 3.12.0
140
+
*/
141
+
this.renderOrder=mapData.renderOrder;
142
+
125
143
/**
126
144
* The format of the map data.
127
145
*
@@ -221,6 +239,52 @@ var Tilemap = new Class({
221
239
this.currentLayerIndex=0;
222
240
},
223
241
242
+
/**
243
+
* Sets the rendering (draw) order of the tiles in this map.
244
+
*
245
+
* The default is 'right-down', meaning it will order the tiles starting from the top-left,
246
+
* drawing to the right and then moving down to the next row.
247
+
*
248
+
* The draw orders are:
249
+
*
250
+
* 0 = right-down
251
+
* 1 = left-down
252
+
* 2 = right-up
253
+
* 3 = left-up
254
+
*
255
+
* Setting the render order does not change the tiles or how they are stored in the layer,
256
+
* it purely impacts the order in which they are rendered.
257
+
*
258
+
* You can provide either an integer (0 to 3), or the string version of the order.
259
+
*
260
+
* Calling this method _after_ creating Static or Dynamic Tilemap Layers will **not** automatically
261
+
* update them to use the new render order. If you call this method after creating layers, use their
262
+
* own `setRenderOrder` methods to change them as needed.
263
+
*
264
+
* @method Phaser.Tilemaps.Tilemap#setRenderOrder
265
+
* @since 3.12.0
266
+
*
267
+
* @param {(integer|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'.
0 commit comments