Sign in to follow this  
slingchilders

Retina screen ugly graphics in Phaser

Recommended Posts

I can't get Phaser to display graphics nicely.

Here is my setup:

this.game = new Phaser.Game(this.settings.windowWidth, this.settings.windowHeight, Phaser.WEBGL, 'area', this, true, false);
 
this.sprite = Engine.instance.game.add.sprite(x, y, key);
 
this.sprite.update = this.update.bind(this);
 
this.sprite.anchor.setTo(0.5, 0.5);
this.sprite.smoothed = true;
 
var scale = (1.0/window.devicePixelRatio);
 
this.sprite.scale.setTo(scale, scale);
this.sprite.smoothed = false;

The graphics loaded here are 2x larger for pixelRatio 2.

The first screenshot is in desktop, and looks really nice.

Why is phaser so ugly on iOS? It's iphone SE.

 

pc.png

24E11586-A112-4C82-BE8B-A0E579290851.png

Share this post


Link to post
Share on other sites

I think you need to either set GameConfig.resolution (although that seems buggy) or enlarge the game canvas and then scale down.

Also, if you use GameConfig.antialias=true, there's no need to set smoothed=true on any objects.

Share this post


Link to post
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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.