Hi guys, I don't know if this question has already been asked and I apologize if it has.
I want to be able to increase/decrease the font size of the dialog box with a slider in the Preferences menu, but I have no idea how to do it, since the fontsize is set with "define" and is therefore a constant non-variable.
If you press Shift+A in the game an "Accesibility Menu" appears and there is a corresponding slider to scale the text, I would like to have this option in the Preferences, because it makes much more sense there, imho.
Is this possible? If yes, how do I do that?
[Solved] Dialogue font scaling slider in preferences menu?
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.
-
- Regular
- Posts: 61
- Joined: Mon Apr 24, 2023 9:06 am
- Completed: Harold And The Witches
- Projects: Steven On The Run
- itch: dantom
- Location: Germany
- Contact:
[Solved] Dialogue font scaling slider in preferences menu?
Last edited by Another_Tom on Mon Jul 17, 2023 10:38 am, edited 1 time in total.
Re: Dialogue font scaling slider in preferences menu?
Code: Select all
bar value Preference("font size")
-
- Regular
- Posts: 61
- Joined: Mon Apr 24, 2023 9:06 am
- Completed: Harold And The Witches
- Projects: Steven On The Run
- itch: dantom
- Location: Germany
- Contact:
Re: Dialogue font scaling slider in preferences menu?
Thank you very much for your reply, _ticlock! I am on vacation this weekend, will test it in the following days and report later. I can't believe it's that simple (Preference("font size")) but am happy if it is!
-
- Regular
- Posts: 52
- Joined: Sun Jul 01, 2018 8:32 am
- Contact:
Re: Dialogue font scaling slider in preferences menu?
It's sadly not that simple if you don't want the whole UI to scale with the font.
A better solution is to make your own slider instead.
Since I was searching for something like that myself a while ago (and it took a lot of googling to find something that simple):
in screens.rpy add:
in gui.rpy replace the line:
with:
edit: almost forgot:
you also need to add the variable to the dialogue:
replace:
with:
in: screen say(who, what)
A better solution is to make your own slider instead.
Since I was searching for something like that myself a while ago (and it took a lot of googling to find something that simple):
in screens.rpy add:
Code: Select all
default persistent.textsize = 45 #put somewhere at the beginning of the script
#and this goes into the screen preferences() with all the other bars:
bar value FieldValue(persistent, "textsize", 31.0, offset=30, style="slider") #higher offset means smaller text, the 31 is is max text size here
Code: Select all
define gui.text_size = 45 #or whatever the original font size was
Code: Select all
define gui.text_size = persistent.text_size
you also need to add the variable to the dialogue:
replace:
Code: Select all
text what id "what"
Code: Select all
text what id "what" size persistent.textsize
Last edited by recreation on Thu Jun 15, 2023 7:41 am, edited 1 time in total.
-
- Regular
- Posts: 61
- Joined: Mon Apr 24, 2023 9:06 am
- Completed: Harold And The Witches
- Projects: Steven On The Run
- itch: dantom
- Location: Germany
- Contact:
Re: Dialogue font scaling slider in preferences menu?
Thank you very much! That worked and is much better than scaling the whole UI.recreation wrote: ↑Mon Jun 12, 2023 5:52 am It's sadly not that simple if you don't want the whole UI to scale with the font.
A better solution is to make your own slider instead.
Who is online
Users browsing this forum: No registered users