Changing the interface/theme

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Glazed Donuts
Regular
Posts: 121
Joined: Thu Aug 12, 2010 11:47 am
Contact:

Changing the interface/theme

#1 Post by Glazed Donuts »

Is there a way to replace the default blue 'Roundrect' theme with your own custom theme? Is the Roundrect theme consisting of just a bunch of JPG images? if so, where are they located in the RenPy project folder and how do you replace those images with your own?

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: Changing the interface/theme

#2 Post by Jake »

Glazed Donuts wrote:Is there a way to replace the default blue 'Roundrect' theme with your own custom theme? Is the Roundrect theme consisting of just a bunch of JPG images? if so, where are they located in the RenPy project folder and how do you replace those images with your own?
Yes, you can change the theme. It's not the most straightforward thing in the world, but it's possible. Firstly, in the most recent version of Ren'Py, there's several more options to choose from in terms of widget style.

The available themes mostly are comprised of .PNG images, and you can find them in the 'common' folder inside the Ren'Py game folder, in sub-folders named things like "theme_tv". The RoundRect theme in particular is just in a folder called '_roundrect'.


If you want to make your own, you could edit one of those directories and replace the built-in theme with one of your own.




In theory, I would expect the following to work: copy the folder and give your new copy a different name, and then go into /common/00themes.rpy, find the line which calls 'roundrect_based_theme' and make a copy of the relevant line (the same one you copied the folder of) and change the name and folder name.

So if you'd copied _theme_diamond and altered all the graphics inside that folder and called it _theme_new, you'd copy this line:

Code: Select all

    roundrect_based_theme("diamond", "_theme_diamond/d")
and make a duplicate with your new values:

Code: Select all

    roundrect_based_theme("diamond", "_theme_diamond/d")
    roundrect_based_theme("new", "_theme_new/d")
Then go into themes_data.rpy in the /launcher folder, and again make a copy of the relevant entry in the 'themes' list at the top of the document:

Code: Select all

        ("Diamond", "diamond", "Colorblind"),
becomes

Code: Select all

        ("Diamond", "diamond", "Colorblind"),
        ("New", "new", "Colorblind"),
(The last item is the colour to use when demoing that theme in the launcher.)

Then further down in that document, find the line setting a 'theme_templates' entry:

Code: Select all

    theme_templates["diamond"] = theme_templates["roundrect"].replace("roundrect", "diamond")
and again:

Code: Select all

    theme_templates["diamond"] = theme_templates["roundrect"].replace("roundrect", "diamond")
    theme_templates["new"] = theme_templates["roundrect"].replace("roundrect", "new")
(To fit in properly, you'd need to take the 'd' prefix from all of the graphics in that folder and replace it with something else - maybe an 'n' for new - and change that in the roundrect_based_theme call as well - but it's not essential, if you keep the image names exactly the same then leave the 'd' or whatever as well.)


However, it doesn't seem to show up, for me. :/
Server error: user 'Jake' not found

Glazed Donuts
Regular
Posts: 121
Joined: Thu Aug 12, 2010 11:47 am
Contact:

Re: Changing the interface/theme

#3 Post by Glazed Donuts »

Thank you! This is exactly what I was looking for! :D

Post Reply

Who is online

Users browsing this forum: henne