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