Jump to content

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


slash
 Share

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.inputEnabled=true;
this.startButton.events.onInputDown.add(this.startGame, this);
...
 
 
startGame = function(){

this.titleLayer.visible = false;

...

}

 

Thanks!

Link to comment
Share on other sites

@slash
 

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

 Share

  • Recently Browsing   0 members

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