[Open-Source] - How To Clear Page With A Color Using JavaScript?


We are working on a new poker game using our HTML5/JavaScript custom 2D Web game engine.

We have a situation that we can’t figure out:
We are trying to clear with “black” color the entire web page that the game runs on.

Please see our code below on Bit Bucket:

You can play the current build (just game shell - no “game” yet) below on Itch:

Let us know, thanks!

Jesse Lee

1 Like

Just set the body element’s background colour to black and it’s HTMLcontents to “”.
If you want to restore the game then add a click event listener on the body element