Search the Community
Showing results for tags 'redraw'.
-
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?
-
Hello! As my game gets the entire window proportionally, I draw more or less stuff depending on the width of the window. It's ok but when I start the game on small window then I resize it, part of the game area stay blank 'cause I just drawed in the start size. So, to get the result I want, by now, when the window resizes I redraw all by restarting the state: window.onresize = function() { gameRatio = window.innerWidth / window.innerHeight; //my default size is 240x160 GAME.scale.setGameSize(Math.ceil(160 * gameRatio), 160); GAME.state.start(GAME.state.current); };The problem is: if the player resizes the window during a gameplay, the state is restarted and he looses what he/she was doing... Is there any other way to redraw all objects when window resizes? Thanks
-
Hey! In my game I have some groups of sprites I dont need to redraw every frame. Some backgorunds, GUI, decoration. Even games objects, when players do nothing. Can I select what sprite I need to redraw at current moment? Thx