Jump to content

CocoonJS + Phaser black screen


Recommended Posts

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?



Link to comment
Share on other sites

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


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...