Maras Posted January 16, 2015 Share Posted January 16, 2015 I am currently trying to make my game work as an android app, but I always get a black screen. Game is coded in TypeScript. What I did:- updated Phaser to 2.2.2 (also tried it with 2.0.7)- used canvas instead of auto- used empty string on Phaser initialization- added empty image in every create fuction (http://likeadev.com/show/6-tips-to-make-your-phaser-game-work-with-cocoonjs.html)- removed all tile sprites What I tried:- Testing with CocoonJS Launcher app as a zip and html link (works in all modes and without any errors / warnings in Canvas+)- Switching to WebView+ and System WebView (also black screen, but WebView+ have white flash before black screen)- Switching compiler versions (2.0.2 / 2.1 / 2.1.1)- Debugging it via Logcat Extreme (no errors) Any ideas? Thanks! jdnichollsc 1 Link to comment Share on other sites More sharing options...
Maras Posted January 18, 2015 Author Share Posted January 18, 2015 I still did not figured this one out, so if anyone have any tips, I would love to hear them. :-) Link to comment Share on other sites More sharing options...
doyouknowyou Posted January 18, 2015 Share Posted January 18, 2015 I've had this problem many times using Cocoon, and unfortunately the only way I could ever solve it was by back-tracking and testing on a trial and error basis until I found what was causing it to crash, as there's no easy way to debug (that I know of?) Mine was something completely random, I think it was to do with font properties and cocoon not liking the way it was rendering. Instead of : // Might be wrong params, only an examplescoreText = game.add.text(SAFE_ZONE_WIDTH/10, buttonY - 2, '0', 'custom', fontColour, fontSize); I had to write as: scoreText = game.add.text(SAFE_ZONE_WIDTH/10, buttonY - 2, '0'); scoreText.font = 'custom'; scoreText.fill = fontColour; scoreText.fontSize = fontSize; Link to comment Share on other sites More sharing options...
Maras Posted January 19, 2015 Author Share Posted January 19, 2015 Thanks for your tip, this unfortunately did not fixed my issue. Link to comment Share on other sites More sharing options...
Maras Posted January 24, 2015 Author Share Posted January 24, 2015 I still did not figured this one out. Any tips? Link to comment Share on other sites More sharing options...
Recommended Posts