Switch from light to dark mode during story

Hi!

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?

Like:

*label scene1
Lorem Ipsum
*page_break Enter the room

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

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.

Example:

Hello

*fake_choice
    #Black
        *script changeBackgroundColor("black")
    #Sepia
        *script changeBackgroundColor("sepia")
    #White
        *script changeBackgroundColor("white")

World

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!)

2 Likes

:ok_hand:

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.

2 Likes

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.