63 GfuiLabelCreateEx(
void *scr,
const char *text,
float *fgColor,
int font,
int x,
int y,
int align,
int maxlen)
74 object->id = screen->
curId++;
76 if (maxlen == 0) maxlen = strlen(text);
77 label = &(
object->u.label);
78 label->
text = (
char*)calloc(maxlen+1, 1);
79 strncpy(label->
text, text, maxlen);
80 label->
text[maxlen] =
'\0';
92 label->
x =
object->xmin = x;
95 object->xmax = x + width;
99 label->
x =
object->xmin = x - width / 2;
102 object->xmax = x + width / 2;
106 label->
x =
object->xmin = x - width;
142 GfuiLabelCreate(
void *scr,
const char *text,
int font,
int x,
int y,
int align,
int maxlen)
189 switch(label->
align&0xF0) {
191 curObject->
xmax = label->
x + w;
194 label->
x = curObject->
xmin = label->
x + pw / 2 - w / 2;
195 curObject->
xmax = curObject->
xmax - pw / 2 + w / 2;
198 label->
x = curObject->
xmin = curObject->
xmax - w;
218 if (curObject != NULL) {
220 curObject = curObject->
next;
221 if (curObject->
id ==
id) {
227 }
while (curObject != screen->
objects);
245 if (curObject != NULL) {
247 curObject = curObject->
next;
248 if (curObject->
id ==
id) {
254 }
while (curObject != screen->
objects);
265 if (label->
bgColor[3] != 0.0) {
int GfuiLabelCreate(void *scr, const char *text, int font, int x, int y, int align, int maxlen)
Add a label to a screen.
void gfuiReleaseLabel(tGfuiObject *obj)
The Gaming Framework API (client part).
GfuiFontClass * gfuiFont[FONT_NB]
void GfuiLabelSetText(void *scr, int id, const char *text)
Change the text of a label.
void GfuiLabelSetColor(void *scr, int id, float *color)
Change the color of a label.
void gfuiAddObject(tGfuiScreen *screen, tGfuiObject *object)
float GfuiColor[GFUI_COLORNB][4]
int GfuiLabelCreateEx(void *scr, const char *text, float *fgColor, int font, int x, int y, int align, int maxlen)
Create a new label (extended version).
int GfuiTitleCreate(void *scr, const char *text, int maxlen)
Add a Title to the screen.
void gfuiDrawLabel(tGfuiObject *obj)
void setRGBA(const float prgba[4])
void gfuiPrintString(int x, int y, GfuiFontClass *font, const char *string)
void gfuiSetLabelText(tGfuiObject *curObject, tGfuiLabel *label, const char *text)
int GfuiTipCreate(void *scr, const char *text, int maxlen)
Add a Tip (generally associated with a button).
int getWidth(const char *text)