Fonts game maker 1.2中的字体问题

Fonts game maker 1.2中的字体问题,fonts,game-maker,gml,Fonts,Game Maker,Gml,我试图在GM中使用多个字体,但在绘图事件中使用draw\u set\u字体时,我的两种绘图字体变得相同,即使我在两个不同的对象中使用draw\u set\u字体。请问,我该如何解决这个问题 这是第一个对象,称为hud: if(global.dead == false){ //Draw health bar draw_sprite(spr_hearts, global.hp, 10,10) //Set score //draw_set_color(c_white)

我试图在GM中使用多个字体,但在绘图事件中使用draw\u set\u字体时,我的两种绘图字体变得相同,即使我在两个不同的对象中使用draw\u set\u字体。请问,我该如何解决这个问题

这是第一个对象,称为hud:

if(global.dead == false){
    //Draw health bar
    draw_sprite(spr_hearts, global.hp, 10,10)
    //Set score
    //draw_set_color(c_white)
    //draw_set_font(fnt_main)
} else {
    draw_text((room_width/2) - 30,room_height/2-30 , "GAME")
    draw_text((room_width/2) - 25,room_height/2 , "OVER")
}
下面是第二个,称为obj_分数:

draw_set_color(c_white)
draw_set_font(fnt_score)
draw_text(140,10,"SCORE : " + string(global.score))
draw\u set\u font()
draw\u set\u color()
等。函数可更改图形管道的全局状态。并不是每个对象都是独立的。因此,对象
hud
应该如下所示:

if !global.dead
{
    // Draw health bar
    draw_sprite(spr_hearts, global.hp, 10, 10);
}
else
{
    draw_set_color(c_white); 
    draw_set_font(fnt_main);
    draw_set_halign(fa_center);
    draw_set_valign(fa_middle);
    draw_text(room_width div 2, room_height div 2, "GAME#OVER"); // or "GAME\nOVER" for GMS2
}
和obj_分数:

draw_set_color(c_white);
draw_set_font(fnt_score);
draw_set_halign(fa_left);
draw_set_valign(fa_top);
draw_text(140, 10, "SCORE : " + string(global.score));
或者,如果你想把它放在一起:

draw_set_color(c_white); 
draw_set_font(fnt_score);
draw_set_halign(fa_left);
draw_set_valign(fa_top);
draw_text(140, 10, "SCORE : " + string(global.score));

draw_set_font(fnt_main);
draw_set_halign(fa_center);
draw_set_valign(fa_middle);
draw_text(room_width div 2, room_height div 2, "GAME#OVER");
显示对象的代码(绘制事件)