slash Posted March 17, 2014 Share Posted March 17, 2014 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=enissue 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 More sharing options...
slash Posted March 18, 2014 Author Share Posted March 18, 2014 It gets weird everytime, I've done all I can to get rid of it but it's still there, I have even destroyed the sprite group, still showing up. It's like I need to clear screen in some way. I don't understand Link to comment Share on other sites More sharing options...
slash Posted March 19, 2014 Author Share Posted March 19, 2014 Was unable to solve this, had to add a big gigantic background image to draw over the remains of those sprites. It works but it's still a mistery Link to comment Share on other sites More sharing options...
Videlais Posted March 19, 2014 Share Posted March 19, 2014 @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 More sharing options...
Recommended Posts