Paumonsu Posted November 17, 2014 Share Posted November 17, 2014 Hi. The Phaser.AUTO isn't working on my website, I think what is happening is that Phaser is rendering WebGL on iphones and tables and as a result, I get a blank page. If I change the line to Phaser.CANVAS it works fine. Is it a known bug or am i doing something wrong? game = new Phaser.Game(windowW, Math.min( windowH, GAME_HEIGHT) , Phaser.AUTO, 'game-container'); // DOESNT WORK game = new Phaser.Game(windowW, Math.min( windowH, GAME_HEIGHT) , Phaser.CANVAS, 'game-container'); // WORKS derloopkat 1 Link to comment Share on other sites More sharing options...
spencerTL Posted November 17, 2014 Share Posted November 17, 2014 On iOS8 auto will select webgl because this can now run on iPads etc and so is a valid setting. Try setting the background of your index page to black as there was an issue a couple of phaser versions ago that required that. Or update to the latest Phaser where this is fixed. Usually this just manifests as a faded out image but if your graphics are a certain colour they may not be visible at all. Link to comment Share on other sites More sharing options...
rvizcaino Posted November 19, 2014 Share Posted November 19, 2014 Still with the latest version of Phaser (downloaded yesterday Nov 18 2014) the performance on iPad 2 WebGl is terrible!, I am just drawing a pair of images and the FPS don't go up of 25. Link to comment Share on other sites More sharing options...
spencerTL Posted November 19, 2014 Share Posted November 19, 2014 Once I switched to atlases rather than individual sprites I noticed no real difference over Canvas on iPad2. Not the boost I'd hoped for, and plenty more work to maintain the speed of canvas on stuff that had been fine until webgl became valid on iOS, but basically okay. Although I tend to just worry about if something feels okay rather than the fps as much of the the stuff I make it doesn't matter. Still it does run smoothly and there are more than 2 sprites. Doesn't tally with your experience, although I'm talking about 2.05 through to 2.07. I've not had chance to try the new RC. Link to comment Share on other sites More sharing options...
Sam Posted November 19, 2014 Share Posted November 19, 2014 on iOS take CANVAS.Apple does not invest in WEBGL as they use metal and swift for native apps.Their WEBGL is only meant for in-browser usage of small scripts (not to run game engines).my games are all running at 60fps in CANVAS mode on iOS8.I've done a lot of optimisation, posted it a few times - here again:http://www.html5gamedevs.com/topic/9931-mobile-performance-tips-tricks/http://www.html5gamedevs.com/topic/8624-phaser-improve-mobile-performance/talking about Phaser 2.1 through 2.2 RC6For best mobile performance use a wrapper like cocoonJS, there you will get the resources to run a game stable on mobile devices.in a website itself it is a lot more complicated due to the low system resources which are offered through the browser.Anyway, the links above will give you a really good starting point what to improve to run your game faster.regards Link to comment Share on other sites More sharing options...
rvizcaino Posted November 19, 2014 Share Posted November 19, 2014 Great SAM, but do you have a device recognition function or something? Canvas for iOS and WebGl for android?? Or all Canvas? Link to comment Share on other sites More sharing options...
Sam Posted November 19, 2014 Share Posted November 19, 2014 Since I do not work on any android devices I am not certain which performs better on Android.If you are running your game in a browser you can verify it by:if( /Android|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {//DO ANDROID, WEB OS, etc}else if ( /iPhone|iPad|iPod|/i.test(navigator.userAgent)){// DO iOS}here is how you detect if WEBGL is enabled (browser - pure js):http://stackoverflow.com/questions/11871077/proper-way-to-detect-webgl-supportMaybe this is interesting too, I use accelerometer, which can be detected by:http://w3c.github.io/deviceorientation/spec-source-orientation.htmlif (window.DeviceMotionEvent != undefined) { //Code to get the alpha, beta, gamma}regards Link to comment Share on other sites More sharing options...
jouniii Posted November 28, 2014 Share Posted November 28, 2014 I noticed that the WebGL does work fine in iOS 8. However only on new devices such as iPhone 6 which have enough processing power. Also this probably was noticed by Apple, because after updating to iOS 8.1, the WebGL was disabled on lower end iOS 8 devices, but is still enabled with the new devices. Thus, Phaser.AUTO will be fine if the iOS8 is the latest version. Link to comment Share on other sites More sharing options...
Recommended Posts