Change textbutton color [SOLVED]

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
User avatar
Mangescom
Newbie
Posts: 16
Joined: Sat Jul 04, 2015 1:45 pm
Deviantart: Mangescom
Contact:

Change textbutton color [SOLVED]

#1 Post by Mangescom »

Hey there, sorry for this noob question.

I have the following code:

Code: Select all

vbox:
        for i in items:
            if " (disabled)" in i.caption:
                $ newcaption = i.caption.replace(" (disabled)", "")
                textbutton newcaption action None
            else:
                textbutton i.caption action i.action
under the choices menu (screens.rpy).

The effect is that when I have a menu:

Code: Select all

    menu:
        "test  (disabled)" if location == "outside":
            pass
        "crimescene" if location == "outside"
            $location = "crimescene"
            scene bg_crimescene
The Option "test" will be unclickable since it is marked as disabled. However the styling looks different from normal menu option. The fontcolor is a darkgrey, while others are a lightgrey. How would I change text color of only this button (or all disabled buttons)?

Thank you in advance
Last edited by Mangescom on Thu Oct 26, 2017 1:56 am, edited 1 time in total.

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Change textbutton color

#2 Post by Divona »

Code: Select all

    vbox:
        for i in items:
            if " (disabled)" in i.caption:
                $ newcaption = i.caption.replace(" (disabled)", "")
                textbutton "{color=#606060}[newcaption]{/color}" action None
            else:
                textbutton i.caption action i.action
Completed:
Image

User avatar
Mangescom
Newbie
Posts: 16
Joined: Sat Jul 04, 2015 1:45 pm
Deviantart: Mangescom
Contact:

Re: Change textbutton color

#3 Post by Mangescom »

Perfect. Thank you!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]