I am migrating a project from Phaser 2 that used a lot of global variables. I’m really confused how to pass data between multiple scenes (imagine an RPG where you are going into rooms and collecting things, etc.).
Can someone recommend a good tutorial for the Data Manager, or a good tutorial on passing a lot of data across scenes please?
I think you need to use the data registry. It was in devlogs #119 under title Exchange Data via the Game Registry.
Before this tiltle theare are two other alternatives mentioned: using events Listening for Scene Events and Calling a Scene Function by getting a reference to a scene from another one.
Thank you but I’m looking for a tutorial. That doesn’t really explain much at all. Do I need to install a DataManager Plug in? How do I use it? etc. I’m looking for a tutorial specifically.
No you do not need to install anything. It actually explains that it is built in among many other things they have renovated about scenes.
Thank you. I’m still looking for a tutorial though.
Hi @casey,
Here an example:
http://labs.phaser.io/edit.html?src=src/scenes\registry%20data%20exchange%20es6.js
And here the docs:
https://photonstorm.github.io/phaser3-docs/Phaser.Data.DataManager.html#toc1__anchor
Regards.
Thank you, but I’ve seen all this. I’m looking for a tutorial that explains it!