Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android stock browser check #989

Merged
merged 1 commit into from
Aug 28, 2014
Merged

Android stock browser check #989

merged 1 commit into from
Aug 28, 2014

Conversation

lucbloom
Copy link
Contributor

This is a class-static function of Phaser.Device to check wether we’re
running on an Android Stock browser. Autors might want to scale down on
effects and switch to the CANVAS rendering method on those devices.
Usage: var defaultRenderingMode = Phaser.Device.isAndroidStockBrowser()
? Phaser.CANVAS : Phaser.AUTO;

This is a class-static function of Phaser.Device to check wether we’re
running on an Android Stock browser. Autors might want to scale down on
effects and switch to the CANVAS rendering method on those devices.
Usage: var defaultRenderingMode = Phaser.Device.isAndroidStockBrowser()
? Phaser.CANVAS : Phaser.AUTO;
@photonstorm
Copy link
Collaborator

Is there a stock browser that even supports WebGL?! Surely they all default to Canvas automatically? Could be useful for determining resolution / effects though.

@lucbloom
Copy link
Contributor Author

The problem is: they report they do, and they have the API calls, but they don't support it very well. I'm having problems with the device "GALAXY Tab3 10.1 Wi-Fi P5210 Android". It renders fine (but slow) in Canvas, but when rendering WebGL, it shows black screens. Some things underneath a SpriteBatch group does display (smoothly) but the rest is rendered in black. The alpha is still transparant though, so it looks like a multiply with [0,0,0] RGB.

I read your article (which was super MVP of you) about the problems with the Samsung S3. Ironically, I was searching in google for a way to open the console on that tablet, to see what JavaScript errors there were (none). Your article was the first place that mentioned about:debug (horrible Samsung method).

I tried some things, like overriding game.add.* with custom functions to make everything an image, a sprite, or making every group a SpriteBatch (or everything a normal group), especially turning Text-s into Sprites (showing nothing :-) because you said there were troubles with overlaying WebGL with Canvas objects. Now I'm thinking of it, I have one Graphics object. Could that be causing this?

Switching off "OpenGL rendering" didn't work for me, but switching off "WebGL" did. So that is why I created this utility function.

@lucbloom
Copy link
Contributor Author

These are the days I hate the open-ness of Android :-(

@photonstorm
Copy link
Collaborator

I hate Android most days.

photonstorm added a commit that referenced this pull request Aug 28, 2014
@photonstorm photonstorm merged commit ee579c2 into phaserjs:dev Aug 28, 2014
@photonstorm
Copy link
Collaborator

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants