Darker Posted October 14, 2015 Share Posted October 14, 2015 I'd like to expand the canvas on the whole screen every time screen size changes to make sure game uses whole browser window. I'm not talking about CSS styles like width: 100%, I want to have larger rendering area allowing for better zoom etc... Seems like basic feature, yet impossible to achieve with PIXI.js, why is that? Quote Link to comment Share on other sites More sharing options...
xerver Posted October 14, 2015 Share Posted October 14, 2015 Pixi.js draws on the entire canvas, all the time. Resizing the canvas to the size you want is what you should be doing. You can use the renderer.resize() method to resize the canvas for you. Quote Link to comment Share on other sites More sharing options...
d13 Posted October 14, 2015 Share Posted October 14, 2015 If you want to scale the canvas to the maximum browser window size while keeping it proportionally centred, you can custom utility function called `scaleToWindow`: https://github.com/kittykatattack/scaleToWindow 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.