how to word wrap?
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: 4
- Joined: Wed Jan 24, 2024 1:59 pm
- Contact:
how to word wrap?
Hi,
in the script.rpy file I have something like:
j "Greetings! ( press the space-bar to continue )"
How can I force a new line for: ( press the space-bar to continue )"
Thanks and kind regards
in the script.rpy file I have something like:
j "Greetings! ( press the space-bar to continue )"
How can I force a new line for: ( press the space-bar to continue )"
Thanks and kind regards
-
- Newbie
- Posts: 4
- Joined: Wed Jan 24, 2024 1:59 pm
- Contact:
Re: how to word wrap?
Hi,
in the script.rpy file I have something like:
j "Greetings! ( press the space-bar to continue )"
j is a Character.
How can I force a new line for: ( press the space-bar to continue )"
Thanks and kind regards
in the script.rpy file I have something like:
j "Greetings! ( press the space-bar to continue )"
j is a Character.
How can I force a new line for: ( press the space-bar to continue )"
Thanks and kind regards
- Sugar-Junkie
- Regular
- Posts: 63
- Joined: Sat Jul 14, 2012 9:08 am
- Projects: Smile for Me (WIP), Greystone Manor (hiatus)
- Location: France
- Contact:
Re: how to word wrap?
Maybe j "Greetings! {p}( press the space-bar to continue )" ? It does create a paragraph break, but it pauses between both lines, unsure if that's how you want it to go.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3794
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: how to word wrap?
You could add a hard linebreak with \n
I believe triple quoted strings also work (but I haven't tested this)
These will format the text however you enter it.
Edited to fix an error in original post
Code: Select all
j "Greetings!\n( press the space-bar to continue )"
I believe triple quoted strings also work (but I haven't tested this)
These will format the text however you enter it.
Code: Select all
j _("""Greetings!
( press the space-bar to continue )""")
Last edited by Imperf3kt on Fri Jan 26, 2024 4:08 pm, edited 2 times in total.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
-
- Newbie
- Posts: 4
- Joined: Wed Jan 24, 2024 1:59 pm
- Contact:
Re: how to word wrap?
Thanks to Sugar-Junkie and Imperf3kt,
as a beginner I appreciate your help very much. Both {p} and \N do not work. They give no error but fail in giving out two lines at the same time. I asked chatGPT3.5 which suggested [br] which results in errors. Also using 'vpunch' or using a variable did not work.
$ text_to_display = "wort1 wort2\nwort3"
e " {text_to_display}
It is very well possible that I made errors, but such a simple need should not require such an effort. Finally, on second try triple quotes worked with the following formating:
j """
This is a multi-line say statement.
It allows you to display text over multiple lines
without the need for explicit line breaks.
"""
Thanks again
Lighthouse
PS out of topic, how do I insert an logo/avatar in my profile?
as a beginner I appreciate your help very much. Both {p} and \N do not work. They give no error but fail in giving out two lines at the same time. I asked chatGPT3.5 which suggested [br] which results in errors. Also using 'vpunch' or using a variable did not work.
$ text_to_display = "wort1 wort2\nwort3"
e " {text_to_display}
It is very well possible that I made errors, but such a simple need should not require such an effort. Finally, on second try triple quotes worked with the following formating:
j """
This is a multi-line say statement.
It allows you to display text over multiple lines
without the need for explicit line breaks.
"""
Thanks again
Lighthouse
PS out of topic, how do I insert an logo/avatar in my profile?
- Ocelot
- Lemma-Class Veteran
- Posts: 2407
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: how to word wrap?
it is \n not \N (capitalization matter)
For the future, it is nessesary to specify what "does not work" means. Does it crashes without giving any errors? Does it give you an error? Does it work, but output is not what you want? If so, what did you get, and what did you expect? Or maybe it does give you what you want, but with some side effects, that makes it unuseable?
For the future, it is nessesary to specify what "does not work" means. Does it crashes without giving any errors? Does it give you an error? Does it work, but output is not what you want? If so, what did you get, and what did you expect? Or maybe it does give you what you want, but with some side effects, that makes it unuseable?
< < insert Rick Cook quote here > >
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3794
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: how to word wrap?
Oops, that's my mistake. I always confuse whether I'm supposed to capitalize that or not
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
-
- Newbie
- Posts: 4
- Joined: Wed Jan 24, 2024 1:59 pm
- Contact:
Re: how to word wrap? Addition and SOLVED
For the benefit of all I may add that within a triple quotes say statement one can force a linebreak by using \n.
Who is online
Users browsing this forum: Google [Bot], Sirifys-Al, Zapor