How to set aspect ratio in blits and solidjs


I am using the lightningJS new framework approach for my app, but I am getting a scroll bar in the browser. How to get rid of that?


Hi @nmnb18 . This is probably because the size of the canvas is bigger than the viewport of the browser that’s running it. You have multiple options to remove it:

  • Display the browser window on a screen with higher resolution
  • Reduce the size of the canvas (stage) and scale it. More information on the official documentation
  • If you still somehow need to keep everything as is, but still need to get rid of the scrollbar, though javascript, you could add an overflow: hidden style to the body of the document, but this is NOT recommended, as you shouldn’t be needing CSS at all while using Lightning.

Hope this helps.