font_exists


描述

This function returns whether a font with the specified index exists or not. Please note, that the value used for checking must have been initialised previously or else you will get an error causing GameMaker Studio 2 to close.


语法:

font_exists(ind);


参数 描述
ind 待检测的字体索引。


Returns:

Boolean


例如:

if font_exists(fnt_Main)
   {
   draw_set_font(fnt_Main);
   }

这段代码在fnt_Main字体存在时将其设置为活动字体。