Pixel-Composer/scripts/draw_UI_scale/draw_UI_scale.gml

28 lines
561 B
Plaintext
Raw Normal View History

2022-11-03 11:44:49 +01:00
function line_height(font = noone, offset = 0) {
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-03-26 07:13:36 +02:00
function line_width(txt, font = noone, offset = 0) {
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
#macro TEXTBOX_HEIGHT line_height(f_p0, 12)
2022-11-03 11:44:49 +01:00
2023-04-08 20:06:27 +02:00
gml_pragma("forceinline");
function ui(val) { return val * UI_SCALE; }
#endregion