phaser icon indicating copy to clipboard operation
phaser copied to clipboard

An event that gets dispatched AFTER the Scene.create() method as been executed.

Open jackfreak opened this issue 7 years ago • 2 comments

I think it would be very helpful to have a Phaser.Scenes.Events.CREATED triggered after the create() method is done. The point of this is to be able to get a reference of some game object or any other asset created by SceneA from SceneB. This kind of events can be useful in multi-scene scenarios, it would let us know in which part of the scene lifecycle we are on.

Also consider applying something similar after init() and preload(). We already have events dispatched for the update loop (PRE_UPDATE, UPDATE, POST_UPDATE, RENDER), for the scene startup we have the BOOT and READY events, but we are missing the init-preload-create portion of the lifecycle of a scene. =)

jackfreak avatar Feb 26 '19 05:02 jackfreak

Have added a new CREATE event for specifically this. I think init and preload are too specific really and can be handled by just emitting your own event via the Scene event emitter (as they're both already covered by other events, but create wasn't)

photonstorm avatar Feb 26 '19 11:02 photonstorm

Thank you for submitting this feature request. We have implemented this and the feature has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

photonstorm avatar Feb 26 '19 11:02 photonstorm