How to change textbutton color, size and font?

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
GeeSeki
Regular
Posts: 112
Joined: Sat Dec 17, 2016 3:39 am
Projects: A Town Uncovered
itch: geeseki
Contact:

How to change textbutton color, size and font?

#1 Post by GeeSeki »

For 'text', it works perfectly fine:

Code: Select all

text "+Spelling and Grammar Fixes" color "#131212" size 35 font "KGSorryNotSorryChub.ttf"
but for 'textbutton', it doesn't work at all:

Code: Select all

textbutton "Alpha 0.20" color "#131212" size 35 font "KGSorryNotSorryChub.ttf":
Where and how do I change it?

DannX
Regular
Posts: 99
Joined: Mon Mar 12, 2018 11:15 am
Contact:

Re: How to change textbutton color, size and font?

#2 Post by DannX »

Try either using text tags directly in the string (really hard to read):

Code: Select all

textbutton "{color=#131212}{size=35}{font=KGSorryNotSorryChub.ttf}Alpha 0.20" action NullAction()
Or using a style (easier to read):

Code: Select all

style tx_button:
    color "#131212"
    size 35
    font "KGSorryNotSorryChub.ttf"
    
screen my_screen():

    textbutton "Alpha 0.20":
        text_style "tx_button"
        action NullAction()

Post Reply

Who is online

Users browsing this forum: Andredron, Majestic-12 [Bot]