font_get_name


描述

This function can be used to get the name (as a string) that was given to the font when it was added as an asset to the GameMaker Studio 2 resource tree. Please note that this is only a string and cannot be used to reference the font directly - for that you would need the font index. You can, however, use this string to get the font index using the returned string along with the function asset_get_index().


语法:

font_get_name(ind);


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


Returns:

字符串


例如:

fnt_Name = font_get_name(font0);

The above code will get the name of a font resource as it appears in the resource tree and store it as a string in the variable "fnt_Name".