Hi all,
i read documentation and i’m able to pass parameter through the scenes, but i’m not configuring out how pass parameter when the game starts. I mean i’d like to pass the username and password to the game when it starts.
Thank you in advance
Hi all,
i read documentation and i’m able to pass parameter through the scenes, but i’m not configuring out how pass parameter when the game starts. I mean i’d like to pass the username and password to the game when it starts.
Thank you in advance
Pass it where? If you just need to store it in the game:
new Phaser.Game({
// …
callbacks: {
preBoot: function (game) {
game.registry.merge({
username: 'Flora'
});
}
}
});
If you want to receive it in scene init(data)
or create(data)
it’s different.
Thx for the replay, I’m able to pass value as you wrote, but my question wa not clear. My problem is that i have some games developed in phaser. Each game needs a login to play. Now I’d like to have only one login and pass to credentials to the game when it starts. All the login process happens in react component so how can i pass value to the configuration of phaser game? thx in advance