Jump to content

LCDGame.js can someone help with the CSS layout?


Recommended Posts

I've been working on my LCDGame.js library some more, and I've added an info pop-up and a highscore list. :)The actual game is rendered in a canvas and the buttons, infobox and highscore list are DIV elements on top of that canvas. The DOM tree is added at run-time when the Game object in the library starts.

I don't know that much about layout and CSS stuff, so my questions are:

  • any tips on scaling the canvas in real-time (so when window resizes)?
  • any tips on scaling the info and highscore DIVs? (without using additional libraries)
  • general improvements
  • any suggestions on making it look prettier are welcome 

See github and specifically the layout_tester.html here

Link to comment
Share on other sites

Hi man!

– You can attach addEventListener with 'resize' event to 'Window' object and handle resizing of your canvas manually when window's size changes.
– You can easily scale any DIV blocks by changing 'width' and 'height' properties of the object. You can also change style of your object by javascript.

Write me in a case if you need examples.

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.

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.


  • Recently Browsing   0 members

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