mirror of
https://github.com/photonstorm/phaser
synced 2024-11-13 00:17:24 +00:00
Tilemap.createFromObjects has been updated for Tiled 0.11 and can now look-up object layers based on id, uid or name. It will also now copy over Sprite scaling properties if set (thanks @mandarinx #1738)
This commit is contained in:
parent
78e7be5c96
commit
f155ad452c
2 changed files with 13 additions and 9 deletions
|
@ -253,6 +253,7 @@ Version 2.3.1 - "Katar" - in dev
|
|||
* TypeScript definitions fixes and updates (thanks @clark-stevenson @isuda @ggarek)
|
||||
* Added missing `resumed` method to Phaser.State class template.
|
||||
* Color.webToColor and Color.updateColor now updates the `out.color` and `out.color32` properties (thanks @cuixiping #1728)
|
||||
* Tilemap.createFromObjects has been updated for Tiled 0.11 and can now look-up object layers based on id, uid or name. It will also now copy over Sprite scaling properties if set (thanks @mandarinx #1738)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
|
|
|
@ -394,23 +394,26 @@ Phaser.Tilemap.prototype = {
|
|||
|
||||
for (var i = 0, len = this.objects[name].length; i < len; i++)
|
||||
{
|
||||
if (typeof this.objects[name][i].gid !== 'undefined' &&
|
||||
typeof gid === 'number') {
|
||||
if (this.objects[name][i].gid === gid) {
|
||||
if (typeof this.objects[name][i].gid !== 'undefined' && typeof gid === 'number')
|
||||
{
|
||||
if (this.objects[name][i].gid === gid)
|
||||
{
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof this.objects[name][i].id !== 'undefined' &&
|
||||
typeof gid === 'number') {
|
||||
if (this.objects[name][i].id === gid) {
|
||||
if (typeof this.objects[name][i].id !== 'undefined' && typeof gid === 'number')
|
||||
{
|
||||
if (this.objects[name][i].id === gid)
|
||||
{
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof this.objects[name][i].name !== 'undefined' &&
|
||||
typeof gid === 'string') {
|
||||
if (this.objects[name][i].name === gid) {
|
||||
if (typeof this.objects[name][i].name !== 'undefined' && typeof gid === 'string')
|
||||
{
|
||||
if (this.objects[name][i].name === gid)
|
||||
{
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue