mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-26 23:17:25 +01:00
28 lines
No EOL
561 B
Text
28 lines
No EOL
561 B
Text
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;
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
#region global
|
|
#macro TEXTBOX_HEIGHT line_height(f_p0, 12)
|
|
|
|
gml_pragma("forceinline");
|
|
function ui(val) { return val * UI_SCALE; }
|
|
#endregion |