Switch from light to dark mode during story


I am working on a project where the character enters a room so dark they can’t see anything, and was wondering if it was possible to force the game to automatically change the theme from light to dark mode (or vice versa) when moving to that dark scene?


*label scene1
Lorem Ipsum
*page_break Enter the room

*label scene2
[code to switch to dark mode]
Lorem Ipsum but dark!

It’s possible by using the *script command to call the native background color switching functions. It involves *script though, so probably can’t be used in published games.



        *script changeBackgroundColor("black")
        *script changeBackgroundColor("sepia")
        *script changeBackgroundColor("white")


NB: Color-switching doesn’t seem to work for me when testing in CSIDE, but does work when testing from the CS folder directly, or when testing in VSCode using the CS extension: New Choicescript extension for VS Code (2.0 now runs games!)



By publish games, do you mean any compiled game? or just the ones published through CoG/HG/HC?
(this is just for a short project for fun, nothing major :joy: )

Published through the official Choice of Games/Hosted Games/Heart’s Choice brands, sorry for not clarifying – projects for fun can use *script to their heart’s content.


No worries, I assumed it was that, but just making sure!

Thanks for the solution~ :green_heart:

Yeah, the current CSIDE release doesn’t support *script.

1 Like

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.