title: Pixi.js - Re-positioning element after window resize
body: <p>I'm quite a noob with Pixi.js so here comes the noob question.</p>
  
  <p>I'm trying to display a square in the middle of the screen. When I resize the window, the square should stay in the middle.</p>
  
  <p>When drawing the square I'm using </p>
  
  <pre><code>const square = new PIXI.Graphics();
  square.beginFill(0xff0000, 1);
  square.drawRect(app.renderer.width /2, app.renderer.height / 2, 50, 50);
  square.endFill();
  app.stage.addChild(square); 
  </code></pre>
  
  <p>Then, I understand that the <code>x</code> and <code>y</code> properties of <code>square</code> are relative to the initial drawing position. So <code>square.x = 0</code> will keep the square in the middle. </p>
  
  <p>But then, how do I reset the center of the window (and so the position of the square) when I resize it?</p>