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
Tilemap.createFromTiles will convert all tiles matching the given tile index (or an array of indexes) into Sprites. You can optionally then replace these tiles if you wish. This is perfect for games when you want to turn specific tiles into Sprites for extra control. The Sprites have an optional properties object which they can be populated with.
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,7 @@ Version 2.2.0 - "Bethal" - in development
105
105
* Time.slowMotion allows you to push the game into a slow motion mode. The default value is 1.0. 2.0 would be half speed, and so on.
106
106
* Time.timeCap is no longer used and now deprecated. All timing is now handled by the fixed time-step code we've introduced.
107
107
* Time.now can no longer be relied upon to contain a timestamp value. If the browser supports requestAnimationFrame then `Time.now` will contain the high resolution timer value that rAf generates. Otherwise it will contain the value of Date.now. If you require the actual time value (in milliseconds) then please use `Time.time` instead. Note that all Phaser sub-systems that used to rely on `Time.now` have been updated, so if you have any code that extends these please be sure to check it.
108
+
* Tilemap.createFromTiles will convert all tiles matching the given tile index (or an array of indexes) into Sprites. You can optionally then replace these tiles if you wish. This is perfect for games when you want to turn specific tiles into Sprites for extra control. The Sprites have an optional properties object which they can be populated with.
* Creates a Sprite for every object matching the given tile indexes in the map data.
423
+
* You can specify the group that the Sprite will be created in. If none is given it will be created in the World.
424
+
* You can optional specify if the tile will be replaced with another after the Sprite is created. This is useful if you want to lay down special
425
+
* tiles in a level that are converted to Sprites, but want to replace the tile itself with a floor tile or similar once converted.
426
+
*
427
+
* @method Phaser.Tilemap#createFromTiles
428
+
* @param {integer|Array} tiles - The tile index, or array of indexes, to create Sprites from.
429
+
* @param {integer|Array} replacements - The tile index, or array of indexes, to change a converted tile to. Set to `null` to not change.
430
+
* @param {string} key - The Game.cache key of the image that this Sprite will use.
431
+
* @param {Phaser.Group} [group=Phaser.World] - Group to add the Sprite to. If not specified it will be added to the World group.
432
+
* @param {object} [properties] - An object that contains the default properties for your newly created Sprite. This object will be iterated and any matching Sprite property will be set.
433
+
* @param {number|string|Phaser.TilemapLayer} [layer] - The layer to operate on.
434
+
* @return {integer} The number of Sprites that were created.
0 commit comments