有任何想法吗 ?我试图做到——我有点做到了——在你死后,“游戏结束”文本出现了“按 R 重新启动”,效果很好,文本并没有消失!
提前致谢
你可以通过多种方式做到这一点,但基础是你需要一个深度足够低的对象,以便它在所有东西的前面,然后在它上面画一个大矩形和一些文本。
您可以创建一个松散的对象;obj_gameover - 具有以下事件:
键盘按下 R:重新启动游戏绘制 GUI 事件:代码:
draw_set_color(c_black); //The color of the screen
draw_rectangle(0, 0, display_get_gui_width(), display_get_gui_height(), 0); //Draw a big rectangle over the GUI
draw_set_color(c_white); //The color of the text
draw_set_font(fnt_myfont); //The font you want for the text
draw_set_halign(fa_center); //Align the text in the center of the screen
draw_text(display_get_gui_width()/2, display_get_gui_height()/2, "Game over!##Press R to restart"); //Draw a text in the center of the GUI. The # sign is a newline in gamemaker.