-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaud_tooltipsdef.h
More file actions
29 lines (28 loc) · 2.1 KB
/
maud_tooltipsdef.h
File metadata and controls
29 lines (28 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef _MUSIC_TOOLTIPSDEF_H
#define _MUSIC_TOOLTIPSDEF_H
#include "maud_textinfodef.h"
#include <SDL2/SDL.h>
#include <SDL2/SDL_ttf.h>
typedef struct maud_tooltip {
char* text; // The text that will be displayed in the tooltip
int x, y; // The horizontal (x) and vertical (y) position of the tooltip when the element is hovered
// by the user (Note the x and y positions will be always relative to the position of
// the element when hovered by the user)
int margin_x, margin_y; // margin_x represents the amount we should center the text within the tooltip canvas
// horizontally while margin_y represents the amount we should center the text within
// the tooltip canvas vertically
SDL_Rect element_canvas; // The area of the button or icon that the tooltip will be displayed for
int wrap_length; // The wrap length determines how much text should be separated by on new line
int wrap_spacing; // The distance between text whenever they are wrapped on new lines
SDL_Color background_color; // background color for the tooltip
SDL_Color text_color; // text color for the tooltip
float delay_secs; // A time in seconds that it will take to start displaying the tooltip on screen
float duration_secs; // A duration or how long the tooltip should be on screen for (If a time of zero is
// specified then the tooltip will display for ever)
int font_size; // The font size of the text that should be displayed within the tooltip
TTF_Font* font; // The font that should be used to render text within the tooltip
int w, h; // the width and the height of the tooltip returned by maud_tooltip_getsize()
text_info_t* contents; // The content list is returned whenever maud_tooltip_render() is called
size_t content_count; // The content count
} maud_tooltip_t;
#endif