Vertically centered text in the text box??
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.
-
bambino358
- Regular
- Posts: 26
- Joined: Sat Apr 27, 2019 7:17 am
- Contact:
Vertically centered text in the text box??
Hi,
I cannot figure out how to vertically centered dialogue text in the textbox.
In the textbox can be 1-3 lines of the text and I want to have the text always in the middle of the textbox. For better ilustration I add simple image to ilustrate, what I want to achieve.
I use Ren'Py 7.0.0.
Basic code for "text position in the textbox" uses "ypos". I tried to replace it with "yalign", but it doesn't work (or I don't know how to do it properly).
So the question is… how to vertically centered dialogue text in the textbox?
Thank you
I cannot figure out how to vertically centered dialogue text in the textbox.
In the textbox can be 1-3 lines of the text and I want to have the text always in the middle of the textbox. For better ilustration I add simple image to ilustrate, what I want to achieve.
I use Ren'Py 7.0.0.
Basic code for "text position in the textbox" uses "ypos". I tried to replace it with "yalign", but it doesn't work (or I don't know how to do it properly).
So the question is… how to vertically centered dialogue text in the textbox?
Thank you
- hell_oh_world
- Miko-Class Veteran
- Posts: 777
- Joined: Fri Jul 12, 2019 5:21 am
- Projects: The Button Man
- Organization: NILA
- Github: hell-oh-world
- Location: Philippines
- Contact:
Re: Vertically centered text in the text box??
have you tried using the special characters?
https://www.renpy.org/doc/html/dialogue ... characters
you can also probably define the position of the window when defining the characters.
or pass parameters in a say statement
or refer to this guide and tweak the different styles found below the say screen in screens.rpy.
https://www.renpy.org/doc/html/gui.html
https://www.renpy.org/doc/html/dialogue ... characters
Code: Select all
vcentered "this dialogue is centered vertically"
centered "this dialogue is centered horizontally and vertically"
Code: Select all
define e = Character("Eileen", window_align=(0.5, 0.5), who_xalign=0.5, what_xalign=0.5)
label start:
e "this dialogue is centered *i think*"
Code: Select all
label start:
e "this dialogue is centered *i think*" (window_align=(0.5, 0.5), who_xalign=0.5, what_xalign=0.5)
https://www.renpy.org/doc/html/gui.html
-
bambino358
- Regular
- Posts: 26
- Joined: Sat Apr 27, 2019 7:17 am
- Contact:
Re: Vertically centered text in the text box??
I think I tried "centered" but the text was in the middle of the screen not in the middle of the textbox, but I'm not sure.
Thanks for reply I'll try it in a few hours.
Thanks for reply I'll try it in a few hours.
-
bambino358
- Regular
- Posts: 26
- Joined: Sat Apr 27, 2019 7:17 am
- Contact:
Re: Vertically centered text in the text box??
Thank you,
this code do the job:
this code do the job:
Code: Select all
define e = Character("name", window_align=(0.5, 1.0), what_xalign=0.5, what_yalign=0.5)Who is online
Users browsing this forum: mold.FF