src/ascension/ui/text.h

changeset 71
baa73a0be3ce
parent 65
9c44c55d327a
equal deleted inserted replaced
70:81a089a47eff 71:baa73a0be3ce
28 #ifndef ASCENSION_UI_TEXT_H 28 #ifndef ASCENSION_UI_TEXT_H
29 #define ASCENSION_UI_TEXT_H 29 #define ASCENSION_UI_TEXT_H
30 30
31 #include "font.h" 31 #include "font.h"
32 #include "../scene.h" 32 #include "../scene.h"
33 #include "../texture.h"
34 #include "../utils.h" 33 #include "../utils.h"
35 34
36 #include <cx/string.h> 35 #include <cx/string.h>
37 36
38 typedef struct AscText { 37 typedef struct AscText {
39 extend_asc_scene_node; 38 AscSprite base;
40 cxmutstr text; 39 cxmutstr text;
41 AscFont font; 40 AscFont font;
42 asc_col4i color; 41 asc_col4i color;
43 unsigned short max_width; 42 unsigned short max_width;
44 unsigned short offx; 43 unsigned short offx;
45 AscTexture tex;
46 } AscText; 44 } AscText;
47 45
48 enum asc_text_alignment { 46 enum asc_text_alignment {
49 ASC_TEXT_ALIGN_LEFT = 0x00, 47 ASC_TEXT_ALIGN_LEFT = 0x00,
50 ASC_TEXT_ALIGN_CENTERED = 0x01, 48 ASC_TEXT_ALIGN_CENTERED = 0x01,
153 AscSceneNode *node, 151 AscSceneNode *node,
154 char const* format, 152 char const* format,
155 ... 153 ...
156 ); 154 );
157 155
158 /**
159 * Releases all the memory of this node.
160 *
161 * @param node the text node
162 */
163 void asc_text_free(AscText *node);
164
165 #endif //ASCENSION_UI_TEXT_H 156 #endif //ASCENSION_UI_TEXT_H

mercurial