#define TOOLTIP_PAD (scale*14) void show_tooltip(s32 x, s32 y, char* buf) { tooltop_visible = true; string_copyn(tooltip_buffer, buf, 100); tooltip_x = x+(20*scale); tooltip_y = y-(fnt_rd16->px_h + (TOOLTIP_PAD))/2; } void update_render_tooltip() { if (!tooltop_visible) return; s32 current_render_depth = gl_render_depth; renderer->set_render_depth(10); s32 info_w = renderer->calculate_text_width(fnt_rd16, tooltip_buffer) + (TOOLTIP_PAD); s32 info_h = fnt_rd16->px_h + (TOOLTIP_PAD); button_draw_background(scale, tooltip_x, tooltip_y, info_w, info_h, COLOR_WHITE, COLOR_BUTTON); renderer->render_text(fnt_rd16, tooltip_x+(TOOLTIP_PAD/2), tooltip_y+(TOOLTIP_PAD/2), tooltip_buffer, COLOR_TEXT); renderer->set_render_depth(current_render_depth); tooltop_visible = false; }