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