Atrinik Client  4.0
Functions | Variables
tooltip.c File Reference
#include <global.h>

Go to the source code of this file.


void tooltip_create (int mx, int my, font_struct *font, const char *text)
void tooltip_enable_delay (uint32_t delay)
void tooltip_multiline (int max_width)
void tooltip_show (void)
void tooltip_dismiss (void)
int tooltip_need_redraw (void)


static char tooltip_text [HUGE_BUF *4]
static font_structtooltip_font
static int tooltip_x = -1
static int tooltip_y = -1
static int tooltip_h = -1
static int tooltip_w = -1
static uint32_t tooltip_created = 0
static uint32_t tooltip_delay = 0
static uint8_t tooltip_opacity = 0

Detailed Description

Tooltip API.

Alex Tokar

Definition in file tooltip.c.

Function Documentation

void tooltip_create ( int  mx,
int  my,
font_struct font,
const char *  text 

Creates a new tooltip. This must be called every frame in order for the tooltip to remain shown.

mxMouse X.
myMouse Y.
fontFont to use, one of FONT_xxx.
textThe text to show in the tooltip.

Definition at line 60 of file tooltip.c.

void tooltip_dismiss ( void  )

Dismiss the currently shown tooltip.

Definition at line 175 of file tooltip.c.

void tooltip_enable_delay ( uint32_t  delay)

Adds a delay before the tooltip is shown.

delayDelay in milliseconds.

Definition at line 82 of file tooltip.c.

void tooltip_multiline ( int  max_width)

Calculate multi-line tooltip height and width.

max_widthMaximum width of the tooltip.

Definition at line 96 of file tooltip.c.

int tooltip_need_redraw ( void  )

Check whether the tooltip needs redrawing.

1 if the tooltip needs redrawing, 0 otherwise.
This needs some actual redrawing check logic. Need various checks like whether the x/y is the same, text/font is the same (in other words, reset old x/y when creating if text/font has changed)

Definition at line 196 of file tooltip.c.

void tooltip_show ( void  )

Actually show the tooltip.

Definition at line 116 of file tooltip.c.

Variable Documentation

font_struct* tooltip_font

Font of the tooltip text.

Definition at line 37 of file tooltip.c.

char tooltip_text[HUGE_BUF *4]

Tooltip's text.

Definition at line 35 of file tooltip.c.

int tooltip_x = -1

Tooltip's X position.

Definition at line 39 of file tooltip.c.

int tooltip_y = -1

Tooltip's Y position.

Definition at line 41 of file tooltip.c.