draw_get_font


Description

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.


Syntax:

draw_get_font();


Returns:

Integer (-1 or font ID value)


Example:

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.