Jump to content

Put game in div with width and height in percentage


mtkachenko
 Share

Recommended Posts

I want to put my phaser game into div like on picture below. Now I use

var game = new Phaser.Game('90', '100', Phaser.CANVAS, 'game-container')

for game, an this layout

<div>HEADER</div>
<div id="palyers-container" style="float: right;">dasdada sdasda</div>
<div id="game-container" style=""></div>

So now I have a vertical scroll (not good) and players-container works in a bad way while resizing browser window. How to fix it?

layout.png

Link to comment
Share on other sites

It really depends on what you're trying to achieve and how what you have now isn't letting you achieve it. You should probably look into using flexbox (depending on what browsers you're targetting) and, possibly, setting "overlay: none" as a CSS property on whatever div it is that has a vertical scroll in it (I'm not sure which one that is).

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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