Hi folks,
I’d like a certain character’s text and name (Josh) to always appear right-aligned, and his name in blue. I thought I had it, but my code isn’t working.
The colour for his name works, but his name is still aligned to the left. If his speech goes onto a second line, then it aligns to the right, but if it’s only a few words and doesn’t go onto a second line, it stays on the left.
Does anyone have any ideas?
define j = character(“Josh”, color=“000080”, what_text_align=1.0)
Make a certain character’s speech text always right align?
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.
-
- Newbie
- Posts: 12
- Joined: Wed May 12, 2021 11:15 am
- Contact:
-
- Regular
- Posts: 159
- Joined: Fri Jan 04, 2019 3:44 pm
- Contact:
Re: Make a certain character’s speech text always right align?
Stab in the dark, but I would guess that the text container (rather than the text within that area) is still left aligned, and so only when the first line stretches that container to be the full width does the alignment of the text within it take effect - manifesting as only affecting the second line onward. Here are two potential solutions (I've not had chance to test either however):
Attempt to align the text container as well as the text inside it:
Try to force the text container to always be maximum width:
Of the two I'd suggest that (if it works) the first is a better option, as depending on the context xfill can sometimes get a bit over zealous and disrupt surrounding containers.
Good luck!
Attempt to align the text container as well as the text inside it:
Code: Select all
define j = character(“Josh”, color=“000080”, what_align=1.0, what_text_align=1.0)
Code: Select all
define j = character(“Josh”, color=“000080”, what_text_align=1.0, what_xfill=True)
Good luck!
Who is online
Users browsing this forum: Google [Bot]