Jump to content

Phaser.AUTO not working on iPhones and iPads


Paumonsu
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

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

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 RC6
For 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

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-support

Maybe this is interesting too, I use accelerometer, which can be detected by:
http://w3c.github.io/deviceorientation/spec-source-orientation.html

if (window.DeviceMotionEvent != undefined) {   //Code to get the alpha, beta, gamma}

regards

Link to comment
Share on other sites

  • 2 weeks later...

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

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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