Jump to content

Problem with group.visible = false on CocoonJS Android, phaser 1.1.6


Recommended Posts

Hello all!


I have a game that works perfect via web, but for the android version made with cocoon using the webview parameter, it seems like the visible attribute for group doesn't work correctly. Why would this happens?


Web Version: http://slashland.co/ananias/

Android: https://play.google.com/store/apps/details?id=co.slashland.ananias&hl=en

issue screenshot: http://imgur.com/bNf89K6


When the user clicks the sprite on the title screen, I'm calling visible = false for its group


initTitleScreen function


this.titleLayer = this.phaser.add.group();
this.startButton = this.phaser.add.sprite(0,0,'startScreen', null, this.titleLayer);
this.startButton.events.onInputDown.add(this.startGame, this);
startGame = function(){

this.titleLayer.visible = false;





Link to comment
Share on other sites


If you are using the WebView mode for CocoonJS, you are actually just using the platform's default browser. For most Android devices, this is usually Chrome or some version of it. Something to try, then, is to load up the game in a browser on the device and see if the same problems happen. If they do, it might not be CocoonJS, but something to do with the browser itself and how it is positioning things.


Something else to think about is that the layout on mobile devices is often different than that of Desktop browsers. It might be that your 320x480 canvas size is being scaled incorrectly. The Android device you are testing on might have a screen size larger than that and the coordinates might be off by some amount.


The problem could also be Phaser itself. I don't remember what fixes made their way into 1.1.6, but I do know 2.0 should be the most up-to-date with patches and fixes for the known issues when working with CocoonJS.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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