I know there has to be a variable somewhere that I'm missing as I'm trying to set variables to change the behavior of textbuttons to be different than style.default . Shouldn't ui.textbutton.font work? I know I can hardcode it per button with {font=} but for the amount of buttons my project has I'd very much would like to change it in one place. Been wrestling with it for around 2 hours looking around both here and the RenPy site so I thought I'd just ask to see if anyone knew off hand.
Any ideas?
Different font for textbuttons
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.
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.
- netravelr
- Miko-Class Veteran
- Posts: 504
- Joined: Thu Jan 28, 2010 2:31 am
- Completed: Culina: Hands in the Kitchen, Culina: The Spirit of Cooking, Saving Zoey
- Projects: Love at the Laundromat
- Organization: Lakeview Interactive
- Deviantart: netravelr
- Location: USA
- Contact:
Different font for textbuttons
Technical Designer/Programmer
Game Design Portfolio - Project updates on my Twitter
Experienced in: C/C++/C#, Python, Unreal, Unity, and Flash
_________________
"Space can be very lonely. The greatest adventure is having someone share it with you."
- netravelr
- Miko-Class Veteran
- Posts: 504
- Joined: Thu Jan 28, 2010 2:31 am
- Completed: Culina: Hands in the Kitchen, Culina: The Spirit of Cooking, Saving Zoey
- Projects: Love at the Laundromat
- Organization: Lakeview Interactive
- Deviantart: netravelr
- Location: USA
- Contact:
Re: Different font for textbuttons
I tried using something similar to what was told there, but I'm sure I'm missing something...
Code: Select all
python:
style.button['Button'].font = "Crystal_Deco.ttf"
while True:
ui.frame(xalign=0,yalign=.5)
ui.vbox()
ui.text("[mc.name] House")
ui.textbutton("{font=Crystal_Deco.ttf}Set Up", clicked=ui.returns(("setup", True)), xminimum=250, style=style.button['Button'], text_style=style.button_text['Foo'])
ui.close()
Technical Designer/Programmer
Game Design Portfolio - Project updates on my Twitter
Experienced in: C/C++/C#, Python, Unreal, Unity, and Flash
_________________
"Space can be very lonely. The greatest adventure is having someone share it with you."
Re: Different font for textbuttons
Did this code worked for you? Did you get an error message or unexpected behaviour?
[ 1) have you declared <style.button_text['Foo']>? 2) I'm afraid that <while True:> will hang your comp up... ]
[ 1) have you declared <style.button_text['Foo']>? 2) I'm afraid that <while True:> will hang your comp up... ]
- netravelr
- Miko-Class Veteran
- Posts: 504
- Joined: Thu Jan 28, 2010 2:31 am
- Completed: Culina: Hands in the Kitchen, Culina: The Spirit of Cooking, Saving Zoey
- Projects: Love at the Laundromat
- Organization: Lakeview Interactive
- Deviantart: netravelr
- Location: USA
- Contact:
Re: Different font for textbuttons
It compiles, but when executed nothing happens.... I don't know.
Technical Designer/Programmer
Game Design Portfolio - Project updates on my Twitter
Experienced in: C/C++/C#, Python, Unreal, Unity, and Flash
_________________
"Space can be very lonely. The greatest adventure is having someone share it with you."
- Aleema
- Lemma-Class Veteran
- Posts: 2677
- Joined: Fri May 23, 2008 2:11 pm
- Organization: happyB
- Tumblr: happybackwards
- Contact:
Re: Different font for textbuttons
Here's how I personally do it. In an init python:
For my button code:
Or is that not what you meant?
Code: Select all
style.create('s_button', 'button')
style.s_button.color = "#ffffff"
style.create('song_button_text', 'button_text')
style.song_button_text.color = "#BABABA"
Code: Select all
ui.textbutton("blah", style="s_button", text_style="song_button_text")
Who is online
Users browsing this forum: 3N16M4