Search the Community

Showing results for tags 'devicepixelratio'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 5 results

  1. Hi Phaser community, It is my first project with Phaser, I am struggling with devicePixelRatio and physics (arcade) body on ipad. When I set the Phaser.Game resolution to 2 (iPad pixel ratio) my sprites are resizing correctly, but the bodies are still positioned as if the resolution was 1. So the body are not positioned on sprites. Does this ring anyone's bell ? How could I match the body position with the sprite position ? Thank you
  2. 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:
  3. Note5 or Galaxy S6 has devicePixelRatio of 4, how do you guys handle different image to be responsive to all the different device aspect ratio and devicePixelRatio?
  4. Hey fellow Pixies, I have blurring issues with my Pixi stuff. At first I thought that this was somehow a Pixi issue (core issue, or me using it wrong). Then I found out this is a general issue with canvas and devicePixelRatio. http://www.html5rocks.com/en/tutorials/canvas/hidpi/ http://phoboslab.org/log/2012/09/drawing-pixels-is-hard I made a small repro myself: http://openspace.subsero.dk/subsero/rohde/pixi_blurring_repro_2/ It shows: 1./ The raw button img tags as shown and scaled by the "normal browser renderengine". 2./ A Pixi playground with the native and retina versions of the image (both blurry). 3./ A normal canvas render (also blurry) 4./ A normal canvas render with the CSS scale method used (sharp) I'm considering rolling my own Pixi modification for this. But I prefer not too, since my understanding of Pixi and gfx stuff limits me to brute hacks. Does anyone know if a solution for this is already available somewhere, or perhaps it is already possible with Pixi in some way that I just haven't spotted yet? I found this post that describes the same issue: http://www.html5gamedevs.com/topic/15406-game-blurred-in-a-retina-ipad/?hl=blurry#entry87308 As the asker also found renderer.context.setTransform(ratio, 0, 0, ratio, 0 ,0); does not seem to make any difference. If I use "resolution: ratio" when initializing the renderer, everything becomes bigger (so that would need to be combined with the CSS-scaling I guess). Best regards Torben Rohde
  5. Hello, Thanks to the amazing v2 of PixiJS, managing devicePixelRatio has become a lot easier. However I'm still not very sure of how everything works and I'm wondering how I should deal with my PIXI.Text ? If I have a DisplayObjectContainer, on a retina display (ratio = 2), can I draw a text, let's say 16px height, into a 8px "retina" height ? I know how to do it with PIXI.BitmapText, it's easy because I only have to load a _@2x BitmapFont and it works fine. But what about classic text ? Thanks a lot ! Regards, JDW.