d13 Posted July 29, 2015 Share Posted July 29, 2015 Hello! The only article I've been able to find on working with multiple resolution images in Pixi is this very old one: http://www.goodboydigital.com/pixi-js-v2-fastest-2d-webgl-renderer/ But there are few details that I don't understand. The text recommends adding "@2x" to image names to set the texture's `resolution` property, but the example code uses "@x2".I guess that "@2x" the correct one? The text also says:"When Pixi detects this it will automatically set the resolution to 2"Does that mean it sets the `texture.baseTexture.resolution` to 2, or does it set the `renderer.resolution` property to 2 - or both? And, if I used `window.DevicePixelRatio` to set the renderer's resolution, does manually using @2x override that value? Quote Link to comment Share on other sites More sharing options...
xerver Posted July 29, 2015 Share Posted July 29, 2015 @2x is correct: https://github.com/pixijs/pixi.js/blob/master/src/core/const.js#L160 Having that string in your filename will set the baseTexture.resolution property for you. It is done at load time: https://github.com/pixijs/pixi.js/blob/07e4e26f8fd404524a7ebaa73c210de3d8f2cf25/src/loaders/textureParser.js#L10 It does not effect renderer.resolution. Quote Link to comment Share on other sites More sharing options...
d13 Posted July 29, 2015 Author Share Posted July 29, 2015 Having that string in your filename will set the baseTexture.resolution property for you.If you don't use @_x in the filename, will the `baseTexture.resolution` be set to 1, or default to the `renderer.resolution` ? Quote Link to comment Share on other sites More sharing options...
xerver Posted July 29, 2015 Share Posted July 29, 2015 It is set to 1, the texture resolution effects the "source size" of the image. The renderer resolution effects the draw size of the image. 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.