Pixel-Composer/objects/o_main/Draw_75.gml

21 lines
573 B
Plaintext
Raw Normal View History

2022-01-13 05:24:03 +01:00
/// @description tooltip filedrop
#region tooltip
if(TOOLTIP != "") {
2022-11-18 03:20:31 +01:00
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
2022-11-03 11:44:49 +01:00
var mx = mouse_mx + ui(16);
var my = mouse_my + ui(16);
2022-01-13 05:24:03 +01:00
2022-01-23 04:08:16 +01:00
var tw = string_width(TOOLTIP);
var th = string_height(TOOLTIP);
2022-01-13 05:24:03 +01:00
2022-11-03 11:44:49 +01:00
if(mouse_mx + tw + ui(16) > WIN_W)
mx = max(0, mouse_mx - ui(16) - tw);
if(mouse_my + th + ui(16) > WIN_H)
my = max(mouse_my - ui(16) - th);
2022-01-13 05:24:03 +01:00
2022-11-18 03:20:31 +01:00
draw_sprite_stretched(THEME.textbox, 0, mx - ui(8), my - ui(8), tw + ui(16), th + ui(16));
2022-01-23 04:08:16 +01:00
draw_text(mx, my, TOOLTIP);
2022-01-13 05:24:03 +01:00
}
TOOLTIP = "";
#endregion