nomatix Posted April 26, 2016 Share Posted April 26, 2016 Hey guys, new html5 developer here. I've been working on my first game with Phaser and all has been great until running into a wall called Cocoon Canvas+. The issue i've been having is getting my game to run in fullscreen through Cocoon.io. I've tested my game using intel XDK and with that service my game scales into fullscreen no problems, but the fps is slow and I need better performance. So i'm trying to get Cocoon canvas+ to work and so far all i get is a small version of my game in the top left corner of the device displayed. There must be something i'm missing in the project setup to enable Cocoon fullscreen to work properly. Has anyone been successful with Cocoon canvas+ fullscreen games and would care to help me out? Thanks I believe the issue lies in my html file. Also I am not sure if I have enabled Cordova properly for Cocoon, or if I even have to enable Cordova. Link to comment Share on other sites More sharing options...
Fatalist Posted April 26, 2016 Share Posted April 26, 2016 That was because of devicepixelratio as far as I remember. Try this page: http://fullscreen.netlify.com/ . Does it scale into fullscreen? Link to comment Share on other sites More sharing options...
nomatix Posted April 27, 2016 Author Share Posted April 27, 2016 not on my iPhone 5, works in my pc browser. Unless there is something more specific i need to do with that url Link to comment Share on other sites More sharing options...
VitaZheltyakov Posted April 27, 2016 Share Posted April 27, 2016 Use code: canvas_width = window.screen.availWidth * window.devicePixelRatio; canvas_height = window.screen.availHeight * window.devicePixelRatio; game = new Phaser.Game(canvas_width, canvas_height, options.render, 'gamewindow'); Link to comment Share on other sites More sharing options...
nomatix Posted April 28, 2016 Author Share Posted April 28, 2016 i'll give this a try. Thanks for your reply Also, out of curiosity, what does the options.render do? Is it just a place marker for Phaser.Canvas? Link to comment Share on other sites More sharing options...
nomatix Posted April 28, 2016 Author Share Posted April 28, 2016 @VitaZheltyakov the code you linked doesn't seem to work in Cocoon with Canvas+. Doesn't work in chrome dev tools either. Maybe I am doing something wrong Link to comment Share on other sites More sharing options...
nomatix Posted April 28, 2016 Author Share Posted April 28, 2016 @VitaZheltyakov nvm your code does work. I just had to tweak some things in my layout. Thanks a lot! Link to comment Share on other sites More sharing options...
Recommended Posts