Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
-
Hoomst
- Newbie
- Posts: 10
- Joined: Wed Jun 08, 2022 9:46 am
-
Contact:
#1
Post
by Hoomst » Mon Oct 03, 2022 11:19 am
I'd like to center multiple lines of text on a screen like this:
Input:
Code: Select all
screen example():
text "This is an interresting \n description. \n Please read it."
Output:
This is an interresting
description.
Please read it.
xalign 0.5 centers the whole text block and not every single line of the text.
Is there a way to achieve that without having to use xalign 0.5 on every line?
Last edited by
Hoomst on Mon Oct 03, 2022 11:58 am, edited 1 time in total.
-
Ocelot
- Eileen-Class Veteran
- Posts: 1882
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
-
Contact:
#2
Post
by Ocelot » Mon Oct 03, 2022 11:23 am
https://www.renpy.org/doc/html/style_pr ... properties
text_align - float
This is used when a line is shorter than the width of the text displayable. It determines how much of the extra space is placed on the left side of the text. (And hence, the text alignment.)
0.0 will yield left-aligned text, 0.5 centered text, and 1.0 right-aligned text.
< < insert Rick Cook quote here > >
-
Hoomst
- Newbie
- Posts: 10
- Joined: Wed Jun 08, 2022 9:46 am
-
Contact:
#3
Post
by Hoomst » Mon Oct 03, 2022 11:58 am
Thank you! That does exactly what I wanted.
Users browsing this forum: Google [Bot], Majestic-12 [Bot]