Transparency of theme elements

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
Morok D
Regular
Posts: 25
Joined: Fri Mar 25, 2016 9:24 am
Contact:

Transparency of theme elements

#1 Post by Morok D »

Can you tell me, please, how can I change transparency of theme elements?

Here I can change the color of elements:

Code: Select all

 theme.diamond(
        ## Theme: Diamond
        ## Color scheme: Dreamscape

        ## The color of an idle widget face.
        widget = "#787878",

        ## The color of a focused widget face.
        widget_hover = "#565656",
But how to change their default transparency?

User avatar
kostek00
Regular
Posts: 131
Joined: Wed Mar 28, 2018 5:54 pm
Contact:

Re: Transparency of theme elements

#2 Post by kostek00 »

Transparency is controlled by "alpha" where 1.0 is fully visible and 0.0 is invisible. Example: "alpha 0.5"

Morok D
Regular
Posts: 25
Joined: Fri Mar 25, 2016 9:24 am
Contact:

Re: Transparency of theme elements

#3 Post by Morok D »

Oh thanks. But how can I change the transparency of the specific theme elements? For example, the choice menu buttons in Diamond theme are displayed as translucent. How can I make them completely opaque?

User avatar
kostek00
Regular
Posts: 131
Joined: Wed Mar 28, 2018 5:54 pm
Contact:

Re: Transparency of theme elements

#4 Post by kostek00 »

You need to find code for that piece and change alpha to 1.0 or if it's in RGBA change last digits to 255.

Morok D
Regular
Posts: 25
Joined: Fri Mar 25, 2016 9:24 am
Contact:

Re: Transparency of theme elements

#5 Post by Morok D »

I apologize for the delay in replying. Thank you, but the problem is that I cannot find where I can change this parameter for default themes (e.g. Diamond Dreamscape). I can make my buttons and change this option for them. But if the default theme settings suit me in everything except this parameter (transparency of the menu buttons) - how can I change it? In general, can I somehow change such parameters for the default themes settings?

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Transparency of theme elements

#6 Post by Imperf3kt »

Themes were deprecated a long time ago.
But, incase you were curious, take a look in this folder on your computer (assuming you're on Windows):
C:\Program Files (x86)\renpy\renpy\common\_theme_diamond
and this file
C:\Program Files (x86)\renpy\renpy\common\00themes.rpy

I think you want to look around line 749-791 with particular interest in lines 764-767

Code: Select all

    def __AWTButton(image, colour, highlight, low_sat=False):
        base_image = "_theme_awt/" + image + ".png"
        colour_tint = im.MatrixColor("_theme_awt/" + image + ".png", im.matrix.colorize(colour, colour))
        opacity = 0.5
        
* I only had a real quick peek, I might be mistaken or there may be much more to it than this alone.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Morok D
Regular
Posts: 25
Joined: Fri Mar 25, 2016 9:24 am
Contact:

Re: Transparency of theme elements

#7 Post by Morok D »

Thank you! Looks like this is what I need.

Post Reply

Who is online

Users browsing this forum: BBN_VN