]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/textlabel.qc
Sort menu classes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / textlabel.qc
1 #ifndef TEXTLABEL_H
2 #define TEXTLABEL_H
3 CLASS(XonoticTextLabel, Label)
4         METHOD(XonoticTextLabel, configureXonoticTextLabel, void(entity, float, string))
5         METHOD(XonoticTextLabel, draw, void(entity))
6         ATTRIB(XonoticTextLabel, fontSize, float, SKINFONTSIZE_NORMAL)
7         ATTRIB(XonoticTextLabel, alpha, float, SKINALPHA_TEXT)
8         ATTRIB(XonoticTextLabel, disabledAlpha, float, SKINALPHA_DISABLED)
9 ENDCLASS(XonoticTextLabel)
10 entity makeXonoticTextLabel(float theAlign, string theText);
11 entity makeXonoticHeaderLabel(string theText);
12 #endif
13
14 #ifdef IMPLEMENTATION
15 entity makeXonoticTextLabel(float theAlign, string theText)
16 {
17         entity me;
18         me = NEW(XonoticTextLabel);
19         me.configureXonoticTextLabel(me, theAlign, theText);
20         return me;
21 }
22 entity makeXonoticHeaderLabel(string theText)
23 {
24         entity me;
25         me = makeXonoticTextLabel(0.5, theText);
26         me.colorL = SKINCOLOR_HEADER;
27         me.alpha = SKINALPHA_HEADER;
28         me.isBold = true;
29         return me;
30 }
31 void XonoticTextLabel_configureXonoticTextLabel(entity me, float theAlign, string theText)
32 {
33         me.configureLabel(me, theText, me.fontSize, theAlign);
34 }
35 void XonoticTextLabel_draw(entity me)
36 {
37         SUPER(XonoticTextLabel).draw(me);
38 }
39 #endif