How to linebreak a textstring in a plotscript?

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
marionline
Metal Slime
Posts: 673
Joined: Sat Feb 26, 2011 9:23 pm

How to linebreak a textstring in a plotscript?

Post by marionline »

Hello!
Is there a way to implem,ent a line break in a string variable?
As you can see on my screenshot, I need a "\n", so to say.

Code: Select all

... 

string sprintf(1, $0="You have nothing to put into the recycler. Gather some organic waste to recycle.")
show textbox (30)
wait for textbox
...
Attachments
space0003.bmp
space0003.bmp (63.55 KiB) Viewed 1156 times
Last edited by marionline on Sun Feb 11, 2018 10:13 pm, edited 1 time in total.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

HSpeak supports \n in strings

Also, string sprintf is redundant there, you can just directly put the text in string 1:

Code: Select all

$1="You have nothing to put into the recycler.\nGather some organic waste to recycle." 
But to get automatic line breaks you should use a text slice set to Wrap.
User avatar
marionline
Metal Slime
Posts: 673
Joined: Sat Feb 26, 2011 9:23 pm

Post by marionline »

Thank you! :D
Post Reply