Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

This is for the options screen:


screen options():

    title "Options"

    vbox:

        # Check if the current background is the light mode image

        if renpy.defaultbg == "your_light_mode_background_image_filename.png":

            textbutton _("Enable Dark Mode") action EnableDarkMode()

        else:

            textbutton _("Disable Dark Mode") action DisableDarkMode()

        textbutton _("Back") action Return()

    # Add this line to use the dark_mode_bg style

    style "options" box_style "dark_mode_bg"

    add "ui/hud/options_background.png"
This is for the script.rpy or whatever .rpy that starts the game:

init:

    # Set the default background to the light mode background image

    $ renpy.defaultbg = "your_light_mode_background_image_filename.png"

label EnableDarkMode():

    # Set the background to the dark mode background image

    $ renpy.defaultbg = "your_dark_mode_background_image_filename.png"

label DisableDarkMode():

    # Set the background to the light mode background image

    $ renpy.defaultbg = "your_light_mode_background_image_filename.png"
I hope this works lol

awesome! Thank you.

I will give this a try soon; however, it looks like this will require a separate textbox to the one already used.  All  U.I elements are hand designed, so give me some time to design a new one and hopefully it'll get working. 😀

If you need to make Dark Mode UI, you can put it into a new folder called "bg_dark" and then replace the code in the script.rpy or whatever file you added start to with the code here:

init:

    # Set the default background to the light mode background image

    $ renpy.defaultbg = "your_light_mode_background_image_filename.png"

label EnableDarkMode():

    # Set the background to the dark mode background image

    $ renpy.defaultbg = "bg_dark/your_dark_mode_background_image_filename.png"

label DisableDarkMode():

    # Set the background to the light mode background image

    $ renpy.defaultbg = "your_light_mode_background_image_filename.png"