jagannadha.sagar Posted November 20, 2019 Share Posted November 20, 2019 Hi, How to scale sprite proportionally according to the screen resolution, is there any in-build functions in PIXI. In Phaser, we can easily do this. https://photonstorm.github.io/phaser-ce/Phaser.ScaleManager.html ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 20, 2019 Share Posted November 20, 2019 PixiJS team doesnt have consensus on how to resize stuff - we prefer user to know this stuff. We have support of resolution (dpi), autoDensity property that sets css dimensions according to resize, and we have https://github.com/pixijs/pixi.js/blob/dev/packages/app/src/ResizePlugin.js You can also scale inside stage itself, or scale UI and game field separately. There's no unified super-resizing component for application. There's also a stupid css+html+fixed_canvas_size way , like here: https://codesandbox.io/s/app-architecture-3-j0di5 , i'm using css flex. So far, no one in community made a resize component that is worth putting into pixi. In that case we prefer to not teach users our bad habits and figure out solutions optimized for their game. If you want to be the hero who finally ports Phaser ScaleManager as a pixi plugin - go for it Quote Link to comment Share on other sites More sharing options...
jagannadha.sagar Posted November 20, 2019 Author Share Posted November 20, 2019 Thanks Ivan. It's really helpful. ivan.popelyshev 1 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.