wijesijp Posted March 12, 2019 Share Posted March 12, 2019 I have a very simple Pixijs project that display a image. There is no animation or anything in it. I wrote simple code to adjust the app size when the user resize the browser window. function resize() { var dis = Math.min(window.innerHeight, window.innerWidth); app.view.width = dis; app.view.height = dis; } window.onresize = function(event) { resize(); }; The problem I have is the canvas get resized, but the content inside it does not redraw. Is there a function in pixi that I can call to redraw or update the canvas? Quote Link to comment Share on other sites More sharing options...
taoprox Posted March 12, 2019 Share Posted March 12, 2019 I have never used pixi.js but I guess you're just resizing the element and not redrawing it after. I am also assuming whatever the canvas is drawing is based on these dimensions so just recall the draw function. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 12, 2019 Share Posted March 12, 2019 renderer has redraw() function. renderer is inside application. 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.