Hello everyone! Hopefully just a quick couple of questions surrounding the GUI.
1. I know how I can change the coloring of a character's name, but I was hoping to change the namebox's color depending on which character was speaking. I replaced the default namebox and it works, but I cannot figure out how to change it for each character.
2. I was also trying to implement a click to continue button for dialogue using a fixed icon. I have the icon appearing on screen but clicking anywhere or hitting enter, still progresses dialogue. Do I have to turn something off for the ctc to work?
Thanks for the help!
GUI Questions [Solved]
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.
- justloveme94
- Newbie
- Posts: 20
- Joined: Sat Nov 18, 2017 11:07 pm
- Contact:
GUI Questions [Solved]
Last edited by justloveme94 on Sun Dec 04, 2022 2:28 pm, edited 1 time in total.
Re: GUI Questions
Looking in the documentation, I see a couple different options that could be relevant when setting up the Character() call.
I don't have time to run tests right now, but here are the areas to look at on there and try out:
Hope that helps!
I don't have time to run tests right now, but here are the areas to look at on there and try out:
- Changing Name Display dynamic: If true, then name should either be a string containing a Python expression, a function, or a callable object. If it's a string, That string will be evaluated before each line of dialogue, and the result used as the name of the character. Otherwise, the function or callable object will be called with no arguments before each line of dialogue, and the return value of the call will be used as the name of the character.
- Click-to-continue: A click-to-continue indicator is displayed once all the text has finished displaying, to prompt the user to advance.
Code: Select all
atts = {
"dynamic": True,
"ctc": True,
}
my_custom_character = Character(name_generation_function(), None, atts)
Re: GUI Questions
1)justloveme94 wrote: ↑Sat Dec 03, 2022 1:03 pm 1. I know how I can change the coloring of a character's name, but I was hoping to change the namebox's color depending on which character was speaking. I replaced the default namebox and it works, but I cannot figure out how to change it for each character.
2. I was also trying to implement a click to continue button for dialogue using a fixed icon. I have the icon appearing on screen but clicking anywhere or hitting enter, still progresses dialogue. Do I have to turn something off for the ctc to work?
Example:Setting config.character_id_prefixes makes it possible to style other displayables as well. For example, when the default GUI is used, styles prefixed with namebox_ are used to style the name of the speaking character.
Code: Select all
style namebox2 is namebox
style namebox2:
background Frame("#f008", gui.namebox_borders, tile=gui.namebox_tile, xalign=gui.name_xalign)
define c = Character("Some_character", namebox_style = 'namebox2')
- justloveme94
- Newbie
- Posts: 20
- Joined: Sat Nov 18, 2017 11:07 pm
- Contact:
Re: GUI Questions
Thank you so much, that worked! Each name box is now changing with each different character. I see what you mean about the ctc. I thought it also controlled clicking. Either way, the ctc at the end of the dialogue box is aesthetically pleasing so I will keep it. Thanks again!
Who is online
Users browsing this forum: Google [Bot], Karrion