You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PlayOptions allows developers to pass values from the container environment to the SpringRoll environment. These values can contain any key value pairs the developer requires. This is typically how language selection is passed from the container to the game.
console.log('New playOptions value set to',playOptions);
67
+
68
+
this.getLanguage();
69
+
});
70
+
71
+
/*Using a default playOptions value for this demo. In a real container environment, the container would set playOptions and pass it into the game automatically. This is just for demonstration purposes to show how playOptions can be used to pass values from the container to the game.
72
+
*/
73
+
this.app.state.playOptions.value={
74
+
language: LANGUAGES.ENGLISH
75
+
};
76
+
53
77
this.app.state.captionsMuted.subscribe(result=>
54
78
{
55
79
console.log('captionsMuted: ',result);
@@ -106,6 +130,39 @@ export class Game
106
130
}
107
131
}
108
132
133
+
getLanguage(){
134
+
if(selectedLanguage){
135
+
returnselectedLanguage;
136
+
}
137
+
138
+
// Check for language param in query string first, this allows us to override the language for testing purposes without having to change the app state or reload the page with new play options. Example: ?language=es
0 commit comments