Jump to content

PIXI JS FOR RETINA DISPLAYS


Daniel Parokonnyy
 Share

Recommended Posts

Good evening! 

    I am creating web-game using pixi js. I have got blury sprites, shapes, text - everything. How can i fix it? I have macbook pro 2015. I think maybe physical and vitual pixels not assigned properly, feeling like 1 vitual pixel of pixi = 4 or 9 physical pixels. I tried set resolution to 2, 3, but it didn`t solve the problem. How can i fix it?

Link to comment
Share on other sites

new PIXI.WebGLRenderer(800, 600, {resolution:2, autoResize:true});

autoResize means that pixi will set CSS dimensions to 800x600, while real canvas dimensions will be 1600x1200. You can do that manually: https://github.com/pixijs/pixi.js/blob/dev/src/core/renderers/SystemRenderer.js#L225

All coordinates should be calculated using "renderer.screen" which are CSS coords (0,0,800,600).

Also make sure you understand how Application works. Its mashup class that supposed to be overriden in your game: https://github.com/pixijs/pixi.js/blob/dev/src/core/Application.js 

Link to comment
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...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...