Game Maker语言新行

时间:2009-11-04 04:43:51

标签: scripting game-maker

我正在编写一个游戏制作者脚本,想知道如何在下一行显示消息。

离。 show_message(“Hello” something +“World”)输出:

Hello
World

8 个答案:

答案 0 :(得分:11)

始终在游戏制作者中使用#作为新行! 所以你应该写

show_message("First Line#Second Line");

这应该有用。

答案 1 :(得分:5)

我不是正面的(之前从未使用过Game Maker),但是手册似乎表明#会起作用(尽管这可能仅适用于draw_string)。你也可以尝试Chr(13)+ Chr(10),这是一个回车和换行。

所以,你可以尝试:

show_message("Hello#World") 

show_message("Hello" + chr(13) + chr(10) +"World") 

来自:http://gamemaker.info/en/manual/gmaker

答案 2 :(得分:3)

尽管其他提到的方法更“正确”,但在Game Maker中你也可以直接在代码编辑器中编写新行:

show_message("Hello
World");

但代码有点混乱。

答案 3 :(得分:2)

要创建新行,请使用#So,例如

打印出来:

Hello
World

使用此:

show_message('Hello#World');

答案 4 :(得分:0)

使用#开始新行:

show_message("Hello World!")  

会这样出来:

Hello World!

然而,

show_message("Hello#World!")  

会这样出来:

Hello
World!

答案 5 :(得分:0)

正如其他人所说,您可以使用"string#this is in a new line" 如果您想将主题标签用作文本而不是换行符,请使用\#

You can look up more information about strings here.

答案 6 :(得分:0)

Game Maker 1.4可以在换行符中使用井号,以及换行符(chr(10)):

show_debug_message("Hello#World");
show_debug_message("Hello" + chr(10) + "World");

自GameMakerStudio 2开始,您现在可以使用转义字符;

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");

答案 7 :(得分:-1)

这是另一个例子。您可以使用函数draw_text(x,y,string)

,而不是显示消息框

这方面的一个例子是:draw_text(320,320,"Hello World");

希望这有帮助