Jump to content


  • Content Count

  • Joined

  • Last visited

Posts posted by ranmasa

  1. Hello,


    first I would like to thank everyone supporting the Pixi.js framework because it is awesome! Thank you a lot!


    Now, to my question. It is probably very simple, but I can not seem to get my head around it.


    I have a container which contains everything the game comprises of. What I would like to do is center it in the middle of the screen. By default, container is at the left border of the screen. 


    What is the simplest way and how would I do it to center my scene/container in the middle of the screen?


    Snippet of a code:

    var width = 1280;var height = 720;var baseWidth = Math.floor(window.innerWidth);var baseHeight = Math.floor(window.innerHeight);var aspectRatio = baseWidth/baseHeight;var renderer = PIXI.autoDetectRenderer(width*aspectRatio, height, {backgroundColor: 0xFFFFFF}); document.body.appendChild(renderer.view);// create an new instance of a pixi stage with a grey backgroundvar stage = new PIXI.Container(); // I WANT TO CENTER THIS CONTAINER 
  • Create New...