Branlin Posted April 27, 2017 Share Posted April 27, 2017 Example: https://jsfiddle.net/b3wtg0hn/ Phaser CE v2.7.7 I display the image with a size of 200 by 200 In the configuration, the devicePixelRatio property with a value 2 I have two problems: 1) The size of the hit (click) area of the sprite is not changing. It is the same as the original file 200x200. But the displayed sprite is 100x100. B the cursor responds to an invisible area 2) The function spriteBounds displays an incorrect position of the sprite bounds. I'm about the green box. I don't know how to fix this. Without using devicePixelRatio everything is blurred on my retina display. It hurts me. I never used CE version. And I have not had these problems on older versions of Phaser. (But then I used method scale.setTo(0.5) for every sprite) Screenshot: Link to comment Share on other sites More sharing options...
samme Posted April 28, 2017 Share Posted April 28, 2017 It may be just a bug in the debug display. You can verify the bounds with debug.spriteInfo(…). Link to comment Share on other sites More sharing options...
Branlin Posted April 28, 2017 Author Share Posted April 28, 2017 1 hour ago, samme said: It may be just a bug in the debug display. You can verify the bounds with debug.spriteInfo(…). debug.spriteInfo() show: bounds x: 50.0 y 50.0 w: 200.0 h: 200.0 This is not the correct value, right? It does not consider scaling. Link to comment Share on other sites More sharing options...
samme Posted April 28, 2017 Share Posted April 28, 2017 (50, 50) is correct. These are "virtual" pixels that don't depend on the device. It's weird, the debug rectangle's position is half what it should be but its size is correct. Link to comment Share on other sites More sharing options...
samme Posted April 28, 2017 Share Posted April 28, 2017 Hm, now I'm confused. Branlin 1 Link to comment Share on other sites More sharing options...
Branlin Posted April 28, 2017 Author Share Posted April 28, 2017 58 minutes ago, samme said: (50, 50) is correct. These are "virtual" pixels that don't depend on the device. It's weird, the debug rectangle's position is half what it should be but its size is correct. I meant about w: 200.0 h: 200.0 45 minutes ago, samme said: Hm, now I'm confused. ¯\_(ツ)_/¯ Link to comment Share on other sites More sharing options...
Recommended Posts