[ACCEPTED]-Game Maker Language new line-game-maker-studio-1.4
For GameMaker: Studio 2, always use \n
as new line.
show_debug_message("First Line\nSecond Line");
For earlier releases, always 1 use #
as new line.
show_message("First Line#Second Line");
I'm not positive (never used Game Maker 5 before) but the manual appears to state 4 that a # will work (though that may only 3 work for draw_string). You can also try 2 Chr(13) + Chr(10), which are a carriage 1 return and linefeed.
So, you could try:
show_message("Hello#World")
or
show_message("Hello" + chr(13) + chr(10) +"World")
Despite the other mentioned methods are 3 more "correct", in Game Maker you can also 2 write the new line straight in the code 1 editor:
show_message("Hello
World");
But codes get a bit messy this way.
To create a new line use # So for example
To 1 print this:
Hello
World
Use this:
show_message('Hello#World');
Game Maker 1.4 can use the pound sign for 3 newlines, as well as the linefeed character 2 (chr(10)
):
show_debug_message("Hello#World");
show_debug_message("Hello" + chr(10) + "World");
Since GameMakerStudio 2 you can now use 1 escaped characters;
show_debug_message("Hello\nWorld");
show_debug_message("Hello#World"); //Will not work, the pound sign is now literal!
show_debug_message("Hello" + chr(10) + "World");
Use #
to start a new line:
show_message("Hello World!")
Would come out 1 like this:
Hello World!
However,
show_message("Hello#World!")
Would come out like this:
Hello
World!
As others have stated you can use "string#this is in a new line"
If you 2 want to use a hashtag as text and not newline 1 use \#
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.