{"action":"created","issue":{"url":"https://api.github.com/repos/photonstorm/phaser/issues/3470","repository_url":"https://api.github.com/repos/photonstorm/phaser","labels_url":"https://api.github.com/repos/photonstorm/phaser/issues/3470/labels{/name}","comments_url":"https://api.github.com/repos/photonstorm/phaser/issues/3470/comments","events_url":"https://api.github.com/repos/photonstorm/phaser/issues/3470/events","html_url":"https://github.com/photonstorm/phaser/pull/3470","id":309883117,"number":3470,"title":"[ISSUE #3363] Phaser Scene - passing data to scene init & create methods","user":{"login":"pixelhijack","id":5672651,"avatar_url":"https://avatars3.githubusercontent.com/u/5672651?v=4","gravatar_id":"","url":"https://api.github.com/users/pixelhijack","html_url":"https://github.com/pixelhijack","followers_url":"https://api.github.com/users/pixelhijack/followers","following_url":"https://api.github.com/users/pixelhijack/following{/other_user}","gists_url":"https://api.github.com/users/pixelhijack/gists{/gist_id}","starred_url":"https://api.github.com/users/pixelhijack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pixelhijack/subscriptions","organizations_url":"https://api.github.com/users/pixelhijack/orgs","repos_url":"https://api.github.com/users/pixelhijack/repos","events_url":"https://api.github.com/users/pixelhijack/events{/privacy}","received_events_url":"https://api.github.com/users/pixelhijack/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-29T19:54:36Z","updated_at":"2018-04-09T09:32:44Z","closed_at":"2018-04-09T09:20:58Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/photonstorm/phaser/pulls/3470","html_url":"https://github.com/photonstorm/phaser/pull/3470","diff_url":"https://github.com/photonstorm/phaser/pull/3470.diff","patch_url":"https://github.com/photonstorm/phaser/pull/3470.patch"},"body":"**[ISSUE #3363] Phaser Scene - passing data to scene init & create methods**\r\n\r\nFixing / workaround for issue #3363 \r\n\r\nAs described in [issue #3363](https://github.com/photonstorm/phaser/issues/3363), in Phaser 3.x the ability of Phaser 2.x passing arbitrary initial data (config) to a starting (boot) scene was broken, as it is not working as expected in the examples either: https://labs.phaser.io/edit.html?src=src\\scenes\\boot%20data.js ({ wibble: 456 } is never logged out, as it was in Phaser 2.x). \r\n\r\nThe issue is, the optional data parameter in the .start() method is copied to entry.data, but after it is added to this._pending as scene, which will re-add the newScene on start, it is not copied further.\r\n\r\nThis commit uses a workaround by copying this optional data param onto the scene (where it is not the proper place i guess), hopefully without causing regression. \r\n\r\nAlso, the idea overlaps a bit with the config's optional 'extend' prop, making it a bit redundant, but now starting a scene like this should be working, available in .init() and .create() methods of the scene, instead of the default empty object: \r\n\r\n`game.scene.start('boot', { someData: '...arbitrary data from BOOT' });`"},"comment":{"url":"https://api.github.com/repos/photonstorm/phaser/issues/comments/379692556","html_url":"https://github.com/photonstorm/phaser/pull/3470#issuecomment-379692556","issue_url":"https://api.github.com/repos/photonstorm/phaser/issues/3470","id":379692556,"user":{"login":"photonstorm","id":164476,"avatar_url":"https://avatars2.githubusercontent.com/u/164476?v=4","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},"created_at":"2018-04-09T09:32:44Z","updated_at":"2018-04-09T09:32:44Z","author_association":"OWNER","body":"Hmm, this now breaks any Scene that doesn't have `data` passed with it :)\r\n\r\nWill look into it more now."}}
{"actor":{"display_login":"photonstorm"}}