noway Posted April 29, 2016 Share Posted April 29, 2016 Hi, I'm toying with Phaser and PhoneGap for the first time, and I have some questions: To make an existing mobile friendly Phaser game work with PhoneGap, I basically only have to: create a config.xml file, and add "phonegap.js" in my index.html file, correct? I added <preference name="orientation" value="landscape"/> in my config file, yet when I try the game in their mobile app I can definitely rotate the game in portrait. Is this supposed to work only when I actually build the game to iOS/Android? Or does it mean that I'm doing something wrong? I don't have a developer account for iOS nor Android. So I cannot build my game to do some tests with PhoneGap Cloud Build, right? It seems that I have to provide developer keys... Thanks! Link to comment Share on other sites More sharing options...
o0Corps0o Posted April 29, 2016 Share Posted April 29, 2016 Hi, We're made one game using Phonegap and i can show you what we used (roughly to get it to work): 1. <?xml version="1.0" encoding="UTF-8" ?> <widget xmlns = "http://www.w3.org/ns/widgets" xmlns:gap = "http://phonegap.com/ns/1.0" id = "com.company.gamename" versionCode = "10" version = "1.0.0" > <!-- versionCode is optional and Android only --> <name>GAME NAME</name> <description> A game made for those who would like games. </description> <author href="http://www.website.com" email="[email protected]"> Awesome Team </author> <gap:platform name="android" /> <preference name="orientation" value="portrait" /> <preference name="fullscreen" value="true" /> <preference name="auto-hide-splash-screen" value="true" /> <preference name="webviewbounce" value="true" /> <preference name="stay-in-webview" value="false" /> <preference name="exit-on-suspend" value="false" /> <preference name="BackgroundColor" value="0x00000000"/> <preference name="permissions" value="none" /> <gap:plugin name="org.apache.cordova.device-orientation" /> <icon src="res/android/new-thumb192.png" /> <platform name="android"> <icon src="res/android/new-thumb36.png" density="ldpi" /> <icon src="res/android/new-thumb72.png" density="mdpi" /> <icon src="res/android/new-thumb144.png" density="hdpi" /> <icon src="res/android/new-thumb192.png" density="xhdpi" /> </platform> <access origin="*" /> </widget> **** For the index.html or whatever you called yours, in ours we have the cordova.js: <script type="text/javascript" src="cordova.js"></script> 2. This should be covered with the above config to keep it whichever orientation you want. (ie. our game doesn't change and stays static) 3. You should be able to build an APK which you can install onto your mobile device without having an account for google play, or ios. Hope that helps a bit. Link to comment Share on other sites More sharing options...
marlene Posted April 29, 2016 Share Posted April 29, 2016 Hi, Have you tried Intel XDK and there is also a tutorial using the phaserJS framework. Just an option. Link to comment Share on other sites More sharing options...
Recommended Posts