{"action":"opened","number":1738,"pull_request":{"url":"https://api.github.com/repos/photonstorm/phaser/pulls/1738","id":33152419,"html_url":"https://github.com/photonstorm/phaser/pull/1738","diff_url":"https://github.com/photonstorm/phaser/pull/1738.diff","patch_url":"https://github.com/photonstorm/phaser/pull/1738.patch","issue_url":"https://api.github.com/repos/photonstorm/phaser/issues/1738","number":1738,"state":"open","locked":false,"title":"Looking up object layers based on id, uid or name","user":{"login":"mandarinx","id":715222,"avatar_url":"https://avatars.githubusercontent.com/u/715222?v=3","gravatar_id":"","url":"https://api.github.com/users/mandarinx","html_url":"https://github.com/mandarinx","followers_url":"https://api.github.com/users/mandarinx/followers","following_url":"https://api.github.com/users/mandarinx/following{/other_user}","gists_url":"https://api.github.com/users/mandarinx/gists{/gist_id}","starred_url":"https://api.github.com/users/mandarinx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mandarinx/subscriptions","organizations_url":"https://api.github.com/users/mandarinx/orgs","repos_url":"https://api.github.com/users/mandarinx/repos","events_url":"https://api.github.com/users/mandarinx/events{/privacy}","received_events_url":"https://api.github.com/users/mandarinx/received_events","type":"User","site_admin":false},"body":"The description of the method stated that you could pass a string to look up an object layer based on its name, but the original code only looked for a gui property, regardless of type.\r\n\r\nI'm using Tiled 0.11.0 on OSX, and my exported json-file doesn't contain a gui property on the object layers. Here's a snippet of my file:\r\n```\r\n{\r\n    \"layers\":[\r\n        {\r\n         \"draworder\":\"topdown\",\r\n         \"height\":0,\r\n         \"name\":\"Objects\",\r\n         \"objects\":[\r\n                {\r\n                 \"height\":48,\r\n                 \"id\":1,\r\n                 \"name\":\"pier\",\r\n                 \"properties\":\r\n                    {\r\n\r\n                    },\r\n                 \"rotation\":0,\r\n                 \"type\":\"\",\r\n                 \"visible\":true,\r\n                 \"width\":64,\r\n                 \"x\":208,\r\n                 \"y\":240\r\n                }],\r\n         \"opacity\":1,\r\n         \"properties\":\r\n            {\r\n             \"type\":\"pier\"\r\n            },\r\n         \"type\":\"objectgroup\",\r\n         \"visible\":true,\r\n         \"width\":0,\r\n         \"x\":0,\r\n         \"y\":0\r\n        }]\r\n    }]\r\n}\r\n```\r\n\r\nThe property in my file is called id and not uid. This might be due to changes in one of the later releases of Tiled. I kept the check for uid to avoid possibly breaking compatibility with older versions of Tiled.\r\n\r\nI also added scaling of the sprite.\r\n\r\nFeel free to make formatting changes, or rewrite the function to better fit the programming style of Phaser.","created_at":"2015-04-13T10:40:12Z","updated_at":"2015-04-13T10:40:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/photonstorm/phaser/pulls/1738/commits","review_comments_url":"https://api.github.com/repos/photonstorm/phaser/pulls/1738/comments","review_comment_url":"https://api.github.com/repos/photonstorm/phaser/pulls/comments{/number}","comments_url":"https://api.github.com/repos/photonstorm/phaser/issues/1738/comments","statuses_url":"https://api.github.com/repos/photonstorm/phaser/statuses/b406a612623d4bc99838acb74a568c346604ae38","head":{"label":"mandarinx:patch-1","ref":"patch-1","sha":"b406a612623d4bc99838acb74a568c346604ae38","user":{"login":"mandarinx","id":715222,"avatar_url":"https://avatars.githubusercontent.com/u/715222?v=3","gravatar_id":"","url":"https://api.github.com/users/mandarinx","html_url":"https://github.com/mandarinx","followers_url":"https://api.github.com/users/mandarinx/followers","following_url":"https://api.github.com/users/mandarinx/following{/other_user}","gists_url":"https://api.github.com/users/mandarinx/gists{/gist_id}","starred_url":"https://api.github.com/users/mandarinx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mandarinx/subscriptions","organizations_url":"https://api.github.com/users/mandarinx/orgs","repos_url":"https://api.github.com/users/mandarinx/repos","events_url":"https://api.github.com/users/mandarinx/events{/privacy}","received_events_url":"https://api.github.com/users/mandarinx/received_events","type":"User","site_admin":false},"repo":{"id":33790047,"name":"phaser","full_name":"mandarinx/phaser","owner":{"login":"mandarinx","id":715222,"avatar_url":"https://avatars.githubusercontent.com/u/715222?v=3","gravatar_id":"","url":"https://api.github.com/users/mandarinx","html_url":"https://github.com/mandarinx","followers_url":"https://api.github.com/users/mandarinx/followers","following_url":"https://api.github.com/users/mandarinx/following{/other_user}","gists_url":"https://api.github.com/users/mandarinx/gists{/gist_id}","starred_url":"https://api.github.com/users/mandarinx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mandarinx/subscriptions","organizations_url":"https://api.github.com/users/mandarinx/orgs","repos_url":"https://api.github.com/users/mandarinx/repos","events_url":"https://api.github.com/users/mandarinx/events{/privacy}","received_events_url":"https://api.github.com/users/mandarinx/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mandarinx/phaser","description":"Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.","fork":true,"url":"https://api.github.com/repos/mandarinx/phaser","forks_url":"https://api.github.com/repos/mandarinx/phaser/forks","keys_url":"https://api.github.com/repos/mandarinx/phaser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mandarinx/phaser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mandarinx/phaser/teams","hooks_url":"https://api.github.com/repos/mandarinx/phaser/hooks","issue_events_url":"https://api.github.com/repos/mandarinx/phaser/issues/events{/number}","events_url":"https://api.github.com/repos/mandarinx/phaser/events","assignees_url":"https://api.github.com/repos/mandarinx/phaser/assignees{/user}","branches_url":"https://api.github.com/repos/mandarinx/phaser/branches{/branch}","tags_url":"https://api.github.com/repos/mandarinx/phaser/tags","blobs_url":"https://api.github.com/repos/mandarinx/phaser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mandarinx/phaser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mandarinx/phaser/git/refs{/sha}","trees_url":"https://api.github.com/repos/mandarinx/phaser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mandarinx/phaser/statuses/{sha}","languages_url":"https://api.github.com/repos/mandarinx/phaser/languages","stargazers_url":"https://api.github.com/repos/mandarinx/phaser/stargazers","contributors_url":"https://api.github.com/repos/mandarinx/phaser/contributors","subscribers_url":"https://api.github.com/repos/mandarinx/phaser/subscribers","subscription_url":"https://api.github.com/repos/mandarinx/phaser/subscription","commits_url":"https://api.github.com/repos/mandarinx/phaser/commits{/sha}","git_commits_url":"https://api.github.com/repos/mandarinx/phaser/git/commits{/sha}","comments_url":"https://api.github.com/repos/mandarinx/phaser/comments{/number}","issue_comment_url":"https://api.github.com/repos/mandarinx/phaser/issues/comments{/number}","contents_url":"https://api.github.com/repos/mandarinx/phaser/contents/{+path}","compare_url":"https://api.github.com/repos/mandarinx/phaser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mandarinx/phaser/merges","archive_url":"https://api.github.com/repos/mandarinx/phaser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mandarinx/phaser/downloads","issues_url":"https://api.github.com/repos/mandarinx/phaser/issues{/number}","pulls_url":"https://api.github.com/repos/mandarinx/phaser/pulls{/number}","milestones_url":"https://api.github.com/repos/mandarinx/phaser/milestones{/number}","notifications_url":"https://api.github.com/repos/mandarinx/phaser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mandarinx/phaser/labels{/name}","releases_url":"https://api.github.com/repos/mandarinx/phaser/releases{/id}","created_at":"2015-04-11T19:53:22Z","updated_at":"2015-04-11T19:53:26Z","pushed_at":"2015-04-11T20:16:17Z","git_url":"git://github.com/mandarinx/phaser.git","ssh_url":"git@github.com:mandarinx/phaser.git","clone_url":"https://github.com/mandarinx/phaser.git","svn_url":"https://github.com/mandarinx/phaser","homepage":"http://phaser.io","size":190679,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"photonstorm:dev","ref":"dev","sha":"0b3fc61ba7d5f788302f2e5ec380216cd24536ad","user":{"login":"photonstorm","id":164476,"avatar_url":"https://avatars.githubusercontent.com/u/164476?v=3","gravatar_id":"","url":"https://api.github.com/users/photonstorm","html_url":"https://github.com/photonstorm","followers_url":"https://api.github.com/users/photonstorm/followers","following_url":"https://api.github.com/users/photonstorm/following{/other_user}","gists_url":"https://api.github.com/users/photonstorm/gists{/gist_id}","starred_url":"https://api.github.com/users/photonstorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/photonstorm/subscriptions","organizations_url":"https://api.github.com/users/photonstorm/orgs","repos_url":"https://api.github.com/users/photonstorm/repos","events_url":"https://api.github.com/users/photonstorm/events{/privacy}","received_events_url":"https://api.github.com/users/photonstorm/received_events","type":"User","site_admin":false},"repo":{"id":9393759,"name":"phaser","full_name":"photonstorm/phaser","owner":{"login":"photonstorm","id":164476,"avatar_url":"https://avatars.githubusercontent.com/u/164476?v=3","gravatar_id":"","url":"https://api.github.com/users/photonstorm","html_url":"https://github.com/photonstorm","followers_url":"https://api.github.com/users/photonstorm/followers","following_url":"https://api.github.com/users/photonstorm/following{/other_user}","gists_url":"https://api.github.com/users/photonstorm/gists{/gist_id}","starred_url":"https://api.github.com/users/photonstorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/photonstorm/subscriptions","organizations_url":"https://api.github.com/users/photonstorm/orgs","repos_url":"https://api.github.com/users/photonstorm/repos","events_url":"https://api.github.com/users/photonstorm/events{/privacy}","received_events_url":"https://api.github.com/users/photonstorm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/photonstorm/phaser","description":"Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.","fork":false,"url":"https://api.github.com/repos/photonstorm/phaser","forks_url":"https://api.github.com/repos/photonstorm/phaser/forks","keys_url":"https://api.github.com/repos/photonstorm/phaser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/photonstorm/phaser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/photonstorm/phaser/teams","hooks_url":"https://api.github.com/repos/photonstorm/phaser/hooks","issue_events_url":"https://api.github.com/repos/photonstorm/phaser/issues/events{/number}","events_url":"https://api.github.com/repos/photonstorm/phaser/events","assignees_url":"https://api.github.com/repos/photonstorm/phaser/assignees{/user}","branches_url":"https://api.github.com/repos/photonstorm/phaser/branches{/branch}","tags_url":"https://api.github.com/repos/photonstorm/phaser/tags","blobs_url":"https://api.github.com/repos/photonstorm/phaser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/photonstorm/phaser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/photonstorm/phaser/git/refs{/sha}","trees_url":"https://api.github.com/repos/photonstorm/phaser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/photonstorm/phaser/statuses/{sha}","languages_url":"https://api.github.com/repos/photonstorm/phaser/languages","stargazers_url":"https://api.github.com/repos/photonstorm/phaser/stargazers","contributors_url":"https://api.github.com/repos/photonstorm/phaser/contributors","subscribers_url":"https://api.github.com/repos/photonstorm/phaser/subscribers","subscription_url":"https://api.github.com/repos/photonstorm/phaser/subscription","commits_url":"https://api.github.com/repos/photonstorm/phaser/commits{/sha}","git_commits_url":"https://api.github.com/repos/photonstorm/phaser/git/commits{/sha}","comments_url":"https://api.github.com/repos/photonstorm/phaser/comments{/number}","issue_comment_url":"https://api.github.com/repos/photonstorm/phaser/issues/comments{/number}","contents_url":"https://api.github.com/repos/photonstorm/phaser/contents/{+path}","compare_url":"https://api.github.com/repos/photonstorm/phaser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/photonstorm/phaser/merges","archive_url":"https://api.github.com/repos/photonstorm/phaser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/photonstorm/phaser/downloads","issues_url":"https://api.github.com/repos/photonstorm/phaser/issues{/number}","pulls_url":"https://api.github.com/repos/photonstorm/phaser/pulls{/number}","milestones_url":"https://api.github.com/repos/photonstorm/phaser/milestones{/number}","notifications_url":"https://api.github.com/repos/photonstorm/phaser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/photonstorm/phaser/labels{/name}","releases_url":"https://api.github.com/repos/photonstorm/phaser/releases{/id}","created_at":"2013-04-12T12:27:51Z","updated_at":"2015-04-13T06:34:28Z","pushed_at":"2015-04-13T10:29:59Z","git_url":"git://github.com/photonstorm/phaser.git","ssh_url":"git@github.com:photonstorm/phaser.git","clone_url":"https://github.com/photonstorm/phaser.git","svn_url":"https://github.com/photonstorm/phaser","homepage":"http://phaser.io","size":190679,"stargazers_count":8322,"watchers_count":8322,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2884,"mirror_url":null,"open_issues_count":49,"forks":2884,"open_issues":49,"watchers":8322,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/photonstorm/phaser/pulls/1738"},"html":{"href":"https://github.com/photonstorm/phaser/pull/1738"},"issue":{"href":"https://api.github.com/repos/photonstorm/phaser/issues/1738"},"comments":{"href":"https://api.github.com/repos/photonstorm/phaser/issues/1738/comments"},"review_comments":{"href":"https://api.github.com/repos/photonstorm/phaser/pulls/1738/comments"},"review_comment":{"href":"https://api.github.com/repos/photonstorm/phaser/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/photonstorm/phaser/pulls/1738/commits"},"statuses":{"href":"https://api.github.com/repos/photonstorm/phaser/statuses/b406a612623d4bc99838acb74a568c346604ae38"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":26,"deletions":1,"changed_files":1}}