- added shurtcut function to create menu items
[supertux.git] / src / text.h
1 //
2 // C Interface: text
3 //
4 // Description: 
5 //
6 //
7 // Author: Tobias Glaesser <tobi.web@gmx.de>, (C) 2004
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12
13 #ifndef SUPERTUX_TEXT_H
14 #define SUPERTUX_TEXT_H
15
16 #include "texture.h"
17
18 /* Text type */
19 typedef struct text_type
20   {
21    texture_type chars;
22    texture_type shadow_chars;
23    int kind;
24    int w;
25    int h;
26   }  
27 text_type;
28
29 /* Kinds of texts. */
30 enum {
31    TEXT_TEXT,
32    TEXT_NUM
33 };
34
35 enum TextHAlign {
36    A_LEFT,
37    A_HMIDDLE,
38    A_RIGHT,
39 };
40
41 enum TextVAlign {
42    A_TOP,
43    A_VMIDDLE,
44    A_BOTTOM,
45 };
46
47 void text_load(text_type* ptext, const std::string& file, int kind, int w, int h);
48 void text_draw(text_type* ptext, const char* text, int x, int y, int shadowsize, int update = NO_UPDATE);
49 void text_draw_chars(text_type* ptext, texture_type* pchars, const char* text, int x, int y, int update = NO_UPDATE);
50 void text_drawf(text_type* ptext, const char* text, int x, int y, TextHAlign halign, TextVAlign valign, int shadowsize, int update = NO_UPDATE);
51 void text_draw_align(text_type* ptext, const char* text, int x, int y, TextHAlign halign, TextVAlign valign, int shadowsize, int update = NO_UPDATE);
52 void text_free(text_type* ptext);
53 void erasetext(text_type* ptext, const char * text, int x, int y, texture_type * surf, int update, int shadowsize);
54 void erasecenteredtext(text_type* ptext, const char * text, int y, texture_type * surf, int update, int shadowsize);
55
56 #endif /*SUPERTUX_TEXT_H*/
57