phaserjs / phaser-ce

Phaser CE is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
http://phaser.io
MIT License
1.36k stars 491 forks source link

Display objects have incorrect `width` & `height` when game.resolution ≠ 1 #373

Open puny-d opened 7 years ago

puny-d commented 7 years ago

If I change the game.resolution = 2, the sprite size always be 50x50,which is small in new canvas, I think it should be 100x100.....

samme commented 7 years ago

Like https://codepen.io/samme/pen/QvpBpM?

puny-d commented 7 years ago

In pixi.js when I change the resolution, the sprite would auto calculate to fit it. So l wonder how could I use it property? And what the meaning of resolution in phaser?

samme commented 7 years ago

I'm not sure. In https://codepen.io/samme/pen/QvpBpM it seems to me that the texture size (64 × 64 game pixels) is correct but the sprite size (128 × 128 game pixels) is not.

tgrajewski commented 6 years ago

It worked properly in Phaser v2.6.2 and is broken since at least Phaser CE v2.7.3. Sprites don't scale up when resolution goes up.