EpicKingdom_ Posted May 3, 2018 Share Posted May 3, 2018 Is PhoneGap a good choice for doing this? Link to comment Share on other sites More sharing options...
jonforum Posted May 3, 2018 Share Posted May 3, 2018 1 hour ago, EpicKingdom_ said: Is PhoneGap a good choice for doing this? i use intel xdk, has been discontinued. But it also existe some old setup shared on the web. Bonsaiheldin 1 Link to comment Share on other sites More sharing options...
Mickety Posted May 4, 2018 Share Posted May 4, 2018 Might want to check this too. It's a version of PhoneGap but free (?) https://cordova.apache.org/ Link to comment Share on other sites More sharing options...
EpicKingdom_ Posted May 5, 2018 Author Share Posted May 5, 2018 This is what my Phaser 2 game looks like in an Android emulator, I am not sure why. If I load a basic HTML5 docuiment with a simple h1 tag, it looks fine so it must be something wrong with my game. This is what it should look like. Link to comment Share on other sites More sharing options...
EpicKingdom_ Posted May 5, 2018 Author Share Posted May 5, 2018 Any idea why it would look like that? The emulator I am using is Nexus 5 Oreo 8.0 I believe. Link to comment Share on other sites More sharing options...
EpicKingdom_ Posted May 5, 2018 Author Share Posted May 5, 2018 It runs in the browser just fine when I add the browser as a platform in Cordova CLI, but it doesn't display properly in the Android emulator. Link to comment Share on other sites More sharing options...
EpicKingdom_ Posted May 5, 2018 Author Share Posted May 5, 2018 All of my other vanilla JavaScript projects work properly in the emulator, so it has something to do with Phaser 2. Link to comment Share on other sites More sharing options...
grinmonk Posted May 6, 2018 Share Posted May 6, 2018 @EpicKingdom_ Have you tried scaling your game in a browser? I would recommend using Chrome's device emulation: https://developers.google.com/web/tools/chrome-devtools/device-mode/ Wavertron 1 Link to comment Share on other sites More sharing options...
theNeedle Posted May 6, 2018 Share Posted May 6, 2018 this might be something related to CSP(Content Security Policy). When trying out cordova, I've faced issue where any of assets are not loading. It was solved by removing meta tag related to CSP. I'm not sure that's the best practice but it was okay for just get it to working condition. Other than that I didn't find any other issues. However I didn't run it on emulator, instead I run directly on the device and also made apk and install on several other device and it was working good. Maybe try running on actual device or build an apk? I found this about CSP. I'm not sure this would solve your problem but it might be useful. Link to comment Share on other sites More sharing options...
EpicKingdom_ Posted May 7, 2018 Author Share Posted May 7, 2018 This is what the Phaser 2 game looks like on my local Android device. (EDIT): I can scroll with my finger, it would appear that the game is too large for the device? Here are my settings. let game = new Phaser.Game(800, 720, Phaser.CANVAS); game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; game.scale.pageAlignHorizontally = true; game.scale.pageAlignVertically = true; Link to comment Share on other sites More sharing options...
theNeedle Posted May 7, 2018 Share Posted May 7, 2018 On 5/6/2018 at 1:39 PM, grinmonk said: @EpicKingdom_ Have you tried scaling your game in a browser? I would recommend using Chrome's device emulation: https://developers.google.com/web/tools/chrome-devtools/device-mode/ You might use this device mode to see how your game scales in different mobile devices. If it scales as you want in chrome-devtools than it should scale as it is on mobile device. If you want to disable scroll than you can use some meta tags in html. However I used phaser 3 and scale the game using custom JS function like this. Apart from that I don't have any experience with phaser2. Link to comment Share on other sites More sharing options...
onlycape Posted May 7, 2018 Share Posted May 7, 2018 Hi @EpicKingdom_ I had a similar problem with the mobile devices and the problem was the configuration of my viewport metatag. Link to comment Share on other sites More sharing options...
EpicKingdom_ Posted May 8, 2018 Author Share Posted May 8, 2018 I always use responsive web design in Firefox or Chrome when developing, the game scales in the browser. It just doesn't look right on an emulator or on my local device. Is Phaser not good for mobile development? This is what it looks like in Chrome. (EDIT): I think I will just redesign the entire game to be 100% positive that it designed for mobile first. Link to comment Share on other sites More sharing options...
EpicKingdom_ Posted May 8, 2018 Author Share Posted May 8, 2018 Alright, so I decided to just to just develop for the device I am aiming at (Nexus 5). So I set the canvas to 320px by 640px. Then I am using the Phaser scale methods. I also scaled all the sprites and text down and re-positioned them. This is the new result so far. Link to comment Share on other sites More sharing options...
mattferndale Posted May 9, 2018 Share Posted May 9, 2018 If you get it up on google I can test on my phone and or NOX Link to comment Share on other sites More sharing options...
Recommended Posts