Discord
Login
Community
DARK THEME

is there anything in microScript like \n from Javascript

In javascript you can use \n to break texts.

text("Hello \nWorld",150,150);

writes on the screen as:

Hello
World

Is there anything similar to this in microScript? I have tried \n but it doesn't affect the text, although it does change its color in the editor and isn't read as text.

Thanks for your help!

try this: // linefeed LF=" "

Unlike JavaScript, you can include a newline in a microScript string literal:

print("Hello
World")

If you prefer inline strings, you can use a variable like @neskuk said:

LF = "
"
print("Hello" + LF + "World")

@neskuk I dont understand

@TwiceUponATime That works for the consol, but I want to draw text onto the screen. Sorry if I didn't make that clear.

Multi-line text on the screen built-in, so you have to write your own code to split the text by newlines and draw each line at a decreasing Y position.

@TwiceUponATime I don't understand. So what you're saying is that there's no easy way to do what I'm looking for?

https://microstudio.dev/i/joejoemars/newlinestest/

https://microstudio.dev/i/Martellus/llfcdrawtextex/

Explore >> find >> "text"

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community