Jump to content

Centering game stage


aron.renska
 Share

Recommended Posts

I've just picked up pixi.js as I plan to make a simple browser game and I've got some questions (sorry if those are very simple or stupid!).
1. I followed docs and ended up using Application class to setup the game. Now how can I center the stage on the screen? I tried to add a container which basically contains my whole game stage - indeed I can center it by setting x,y of the container to move it but it offsets coordinate system which I am using to fire projectiles etc. I also tried moving renderer of the application using css styles but it moves whole game, resulting in no background.


2. Is it possible to "integrate" somehow the game made using pixi.js with a generic web page? I would like to make a lobby of some sort where players can create and join game sessions - upon joining it should launch the pixi.js app.

EDIT: maybe I should have mentioned that i used following template https://github.com/miltoncandelero/pixi-hotwire

Edited by aron.renska
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...