draw_get_font


描述

This function will get the font currently assigned for drawing text. The function will return -1 if no font is set, or the ID value (a positive integer) for the font resource assigned.


语法:

draw_get_font();


返回:

Integer (-1 or font ID value)


例如:

if draw_get_font() != fnt_MainMenu
    {
    draw_set_colour(c_blue);
    draw_set_font(fnt_MainMenu);
    }
draw_text(room_width / 2, 200, "MENU" );

The above code will check to see which font is being used for drawing and if it's not fnt_MainMenu, then the font and draw colour are set before some text is drawn to the screen.