Hi. I found this code snippet that is supposed to detect Mobile/Desktop and make config files accordingly. Could you please tell me if this would works with RenJS (i've added a RenJS config example):
var isMobile = navigator.userAgent.indexOf("Mobile");
if (isMobile == -1) {
isMobile = navigator.userAgent.indexOf("Tablet");
}
if (isMobile == -1) {
var globalConfig = {
w:1000,
h:659,
mode: "AUTO",
scaleMode: "NO_SCALE", //SHOW_ALL, EXACT_FIT, NO_SCALE i18n: {
langs: ["en","es"],
path: "mobile/assets/gui/i18n/",
format: ".png",
w: 163,
h: 83
},
splash: { //The "Loading" page for your game
loadingScreen: "mobile/assets/gui/LANG/splash.png", //splash background
loadingBar: {
fullBar: "mobile/assets/gui/LANG/loadingbar.png",
position: {x:111,y:462}
}
},
logChoices: true,
fonts: "mobile/assets/gui/fonts.css",
guiConfig: "mobile/story/GUI.yaml",
storySetup: "mobile/story/Setup.yaml",
//as many story text files as you want
storyText: [
"mobile/story/LANG/YourStory.yaml"
],
}
} else {
var globalConfig = {
w:480,
h:640,
mode: "AUTO",
scaleMode: "NO_SCALE", //SHOW_ALL, EXACT_FIT, NO_SCALE i18n: {
langs: ["en","es"],
path: "desktop/assets/gui/i18n/",
format: ".png",
w: 163,
h: 83
},
splash: { //The "Loading" page for your game
loadingScreen: "desktop/assets/gui/LANG/splash.png", //splash background
loadingBar: {
fullBar: "desktop/assets/gui/LANG/loadingbar.png",
position: {x:111,y:462}
}
},
logChoices: true,
fonts: "desktop/assets/gui/fonts.css",
guiConfig: "desktop/story/GUI.yaml",
storySetup: "desktop/story/Setup.yaml",
//as many story text files as you want
storyText: [
"desktop/story/LANG/YourStory.yaml"
],
}
}
var game = new Phaser.Game(config);