Set dark mode as default

There’s a simple solution. At the very first scene of your game (can be at the end of the startup.txt — before any text), add this piece of code:

*if not(choice_nightmode)
      *script document.body.classList.remove("whitemode"); document.body.classList.add("nightmode");

This forces the game to nightmode without messing up the css. And if the person wants, they can just set the game back to white background in the setting.

This script will do the exactly same thing as if the person went into settings and set the theme to dark mode themselves.

I tried in CSIDE and it throws an error, but when I just compile the game and run it, it works just fine.

8 Likes