2023-05-28 20:00:51 +02:00
|
|
|
function line_get_height(font = noone, offset = 0) {
|
2022-11-03 11:44:49 +01:00
|
|
|
var ff = draw_get_font();
|
|
|
|
|
|
|
|
if(font != noone)
|
|
|
|
draw_set_font(font);
|
|
|
|
var hh = string_height("l") + offset * UI_SCALE;
|
|
|
|
|
|
|
|
draw_set_font(ff);
|
|
|
|
return hh;
|
|
|
|
}
|
|
|
|
|
2023-05-28 20:00:51 +02:00
|
|
|
function line_get_width(txt, font = noone, offset = 0) {
|
2023-03-26 07:13:36 +02:00
|
|
|
var ff = draw_get_font();
|
|
|
|
|
|
|
|
if(font != noone)
|
|
|
|
draw_set_font(font);
|
|
|
|
var ww = string_width(txt) + offset * UI_SCALE;
|
|
|
|
|
|
|
|
draw_set_font(ff);
|
|
|
|
return ww;
|
|
|
|
}
|
|
|
|
|
2023-04-08 20:06:27 +02:00
|
|
|
#region global
|
2023-08-29 14:33:44 +02:00
|
|
|
#macro TEXTBOX_HEIGHT line_get_height(f_p0, 8)
|
2022-11-03 11:44:49 +01:00
|
|
|
|
2023-04-16 16:24:17 +02:00
|
|
|
function ui(val) {
|
|
|
|
gml_pragma("forceinline");
|
|
|
|
return val * UI_SCALE;
|
|
|
|
}
|
2023-04-08 20:06:27 +02:00
|
|
|
#endregion
|