Ren'Py Dialogue box opacity

Peachiy

Newbie
Game Developer
Aug 10, 2024
25
44
Hello everyone, I hope you're doing well.

I want to add the ability to change the dialogue box opacity in my Ren'Py visual novel.

I managed to hide it completely, but I don't know how to add the option to change the dialogue box opacity.

Any tips on how to do this would be appreciated.

Thank you in advance.
 

Wolf1114

Member
May 7, 2017
209
116
So i've seen people using variations of this:
Python:
default persistent.textbox_transparency = 1.0 # Whatever you want the default to be.

screen say(who, what):
    style_prefix "say"

    window:
        id "window"
        background Transform(style.window.background, alpha = 1 - persistent.textbox_transparency, xalign=0.5)
        if who is not None:

            window:
                id "namebox"
                style "namebox"
                text who id "who"

        text what id "what" size persistent.pref_text_size


    ## If there's a side image, display it above the text. Do not display on the
    ## phone variant - there's no room.
    if not renpy.variant("small"):
        add SideImage() xalign 0.0 yalign 1.0

      
# For preferences screen
label _("Textbox Transparency")

bar value FieldValue(persistent, "textbox_transparency", range=1.0, style="slider")
It "SHOULD" work like that. Personally I dislike textboxs tho
 

Peachiy

Newbie
Game Developer
Aug 10, 2024
25
44
So i've seen people using variations of this:
Python:
default persistent.textbox_transparency = 1.0 # Whatever you want the default to be.

screen say(who, what):
    style_prefix "say"

    window:
        id "window"
        background Transform(style.window.background, alpha = 1 - persistent.textbox_transparency, xalign=0.5)
        if who is not None:

            window:
                id "namebox"
                style "namebox"
                text who id "who"

        text what id "what" size persistent.pref_text_size


    ## If there's a side image, display it above the text. Do not display on the
    ## phone variant - there's no room.
    if not renpy.variant("small"):
        add SideImage() xalign 0.0 yalign 1.0

      
# For preferences screen
label _("Textbox Transparency")

bar value FieldValue(persistent, "textbox_transparency", range=1.0, style="slider")
It "SHOULD" work like that.
Thank you I'll try it