Line Breaks

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.
Post Reply
Message
Author
ghazghkull
Newbie
Posts: 5
Joined: Tue Dec 12, 2006 12:29 am
Contact:

Line Breaks

#1 Post by ghazghkull »

Hey I'm just wondering how does one do a line break for this one? I mean I know with HTML you use the <BR> command to make a new line, but how is that done for Ren'Py? Or rather what's the code for Ren'Py?

Watercolorheart
Eileen-Class Veteran
Posts: 1314
Joined: Mon Sep 19, 2005 2:15 am
Completed: Controlled Chaos / Sum of the Parts / "that" Midna game with ZONEsama
Projects: Sparse Series/Oddments Shop original cartoon in Pevrea; Cybernetic Duels (fighting game); Good Vibin'
Organization: Watercolorheart Studios
IRC Nick: BCS
Tumblr: adminwatercolor
Deviantart: itsmywatercolorheart
Github: Watercolordevdev
Skype: heartnotes
Soundcloud: Watercollider
itch: watercolorheart
Location: Florida
Contact:

#2 Post by Watercolorheart »

{p} adds a linebreak while pausing the line, but I don't know if that's what you want ... I never use it, myself ... (very rarely)

So that

"I saw {p} YOU" becomes:

"I saw"

CLICK

"I saw
YOU"
I'm not even the same person anymore

NetGenSuperstar
Regular
Posts: 113
Joined: Sun Oct 08, 2006 1:29 am
Location: BEHIND YOU!!!
Contact:

#3 Post by NetGenSuperstar »

Type \n to get a line break. So:

Code: Select all

"This is\ndialogue."
will display as:

Code: Select all

This is
dialogue.

ghazghkull
Newbie
Posts: 5
Joined: Tue Dec 12, 2006 12:29 am
Contact:

#4 Post by ghazghkull »

Thanks a lot ^^

User avatar
phantmoftheomsi
Newbie
Posts: 17
Joined: Sat Oct 30, 2021 12:57 am
Completed: None yet
Projects: A modern adaptation of ancient Chinese crime fiction.
Deviantart: phantomoftheomsi
Contact:

Re: Line Breaks

#5 Post by phantmoftheomsi »

I tried \n and got an infinite loop.

Is this method for a line break still viable? I noticed this post is 15 years old and the engine may have been updated.

Inksword
Regular
Posts: 83
Joined: Fri Oct 24, 2014 1:20 am
Tumblr: inksword
Contact:

Re: Line Breaks

#6 Post by Inksword »

phantmoftheomsi wrote: Thu Nov 04, 2021 1:00 am I tried \n and got an infinite loop.

Is this method for a line break still viable? I noticed this post is 15 years old and the engine may have been updated.
It works for me:

Code: Select all

"Some words.\nA linebreak"
gives me:
Screen Shot 2021-11-03 at 10.29.21 PM.png

You should probably look at the text documentation next time instead of reviving a fifteen year old thread lol.

User avatar
AVNSnax
Regular
Posts: 79
Joined: Sun Feb 06, 2022 12:11 am
itch: avnsnax
Contact:

Re: Line Breaks

#7 Post by AVNSnax »

Sorry for reviving a 16 (!) -year old thread, but "\n" doesn't in fact appear to work inside a custom text tag...I had to resort to a function and ugly syntax to accomplish this.

User avatar
neometalero
Regular
Posts: 198
Joined: Sun Oct 23, 2016 3:51 am
Completed: My Dream Sport Dating Simulator, Attack Helicopter Dating Simulator
Projects: My Dream Sport Dating Simulator, Attack Helicopter Dating Simulator
Deviantart: neometalero
Contact:

Re: Line Breaks

#8 Post by neometalero »

AVNSnax wrote: Mon Mar 14, 2022 8:21 pm Sorry for reviving a 16 (!) -year old thread, but "\n" doesn't in fact appear to work inside a custom text tag...I had to resort to a function and ugly syntax to accomplish this.
It works. Here https://www.renpy.org/wiki/renpy/doc/FAQ is the official documentation on that
Be sure to write "\n" and not "/n" , and that it is between two blocks of text, not alone.

Here it's an example:

Code: Select all

#Im using a variable since Im displaying this inside a screen
$diaBatRang="All Station, Charlie here. \nThrowing a Stun grenade, everyone in my vicinity cover your eyes and ears."
#You can even add text.
$diaBatRang=diaBatRang+"\nI only have one stun grenade left. We should make it count. Over."
Result in game:
Image
Working on many weird narrative games at Curse Box Studios
Image
https://www.curseboxstudios.com/

User avatar
AVNSnax
Regular
Posts: 79
Joined: Sun Feb 06, 2022 12:11 am
itch: avnsnax
Contact:

Re: Line Breaks

#9 Post by AVNSnax »

neometalero wrote: Sat Jan 27, 2024 11:24 am
AVNSnax wrote: Mon Mar 14, 2022 8:21 pm Sorry for reviving a 16 (!) -year old thread, but "\n" doesn't in fact appear to work inside a custom text tag...I had to resort to a function and ugly syntax to accomplish this.
It works. Here https://www.renpy.org/wiki/renpy/doc/FAQ is the official documentation on that
Be sure to write "\n" and not "/n" , and that it is between two blocks of text, not alone.

Here it's an example:

Code: Select all

#Im using a variable since Im displaying this inside a screen
$diaBatRang="All Station, Charlie here. \nThrowing a Stun grenade, everyone in my vicinity cover your eyes and ears."
#You can even add text.
$diaBatRang=diaBatRang+"\nI only have one stun grenade left. We should make it count. Over."
You didn't read carefully enough. I said "inside a custom text tag." I know it works in normal dialogue. :)

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Line Breaks

#10 Post by Imperf3kt »

Instead of whatever you came up with that you didn't like, have you considered just closing the text tag?

Code: Select all

"words [custom tag]words[/custom tag]\n[custom tag]words[/custom tag]" 
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

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot]