modegames Posted December 23, 2014 Share Posted December 23, 2014 Is it possible to load either retina and non-retina atlas (as required) with pixi.js then using a viewport for a set size (lets say for example at the size of the retina atlas is what our positioning is based upon) be able to position the sprites for each of these atlas resolutions without having to manually multiply all values by a ratio so they use the correct position and size values for the DisplayObjects. Trying this out of course I loaded the retina atlas and then tried loading the non-retina atlas the problem is that the width and height properties are always based on the frame size from the frame in the texture so meaning that these values are not scaled by a content scale factor to normalise them so they vary dependent on the resolution of the atlas which is not normal to expect with cross platform development. Let me know if you've found a solution to work with this common requirement for building games with pixi.js Quote Link to comment Share on other sites More sharing options...
msha Posted December 23, 2014 Share Posted December 23, 2014 Did you try this?http://www.goodboydigital.com/pixi-js-v2-fastest-2d-webgl-renderer/"Oh and a nice easy way to let Pixi know that a texture is for retina is to simply add @2x to the image name. " Quote Link to comment Share on other sites More sharing options...
JDW Posted December 24, 2014 Share Posted December 24, 2014 You'll still have to deal with devicePixelRatio for your positioning. you must divide every height/width by the pixel ratio (but not x and y) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.