Lines Matching refs:me

3 	string Label_toString(entity me)
5 return me.text;
7 void Label_setText(entity me, string txt)
9 me.text = txt;
10 if (txt != me.currentText)
12 if (me.currentText) strunzone(me.currentText);
13 me.currentText = strzone(txt);
14 me.recalcPos = 1;
17 void Label_recalcPositionWithText(entity me, string t)
20 spaceAvail = 1 - me.keepspaceLeft - me.keepspaceRight;
22 if (me.isBold) draw_beginBoldFont();
25 spaceUsed = draw_TextWidth(t, me.allowColors, me.realFontSize);
29 …if (!me.overrideRealOrigin_x) me.realOrigin_x = me.align * (spaceAvail - spaceUsed) + me.keepspace…
30 if (!me.overrideCondenseFactor) me.condenseFactor = 1;
32 else if (me.allowCut || me.allowWrap)
34 if (!me.overrideRealOrigin_x) me.realOrigin_x = me.keepspaceLeft;
35 if (!me.overrideCondenseFactor) me.condenseFactor = 1;
39 if (!me.overrideRealOrigin_x) me.realOrigin_x = me.keepspaceLeft;
40 if (!me.overrideCondenseFactor) me.condenseFactor = spaceAvail / spaceUsed;
41 …LOG_TRACEF("NOTE: label text %s too wide for label, condensed by factor %f", t, me.condenseFactor);
44 if (!me.overrideRealOrigin_y)
51 fs = me.realFontSize;
52 fs.x *= me.condenseFactor;
55 draw_fontscale.x *= me.condenseFactor;
57 if (me.allowCut) // FIXME allowCut incompatible with align != 0
61 else if (me.allowWrap) // FIXME allowWrap incompatible with align != 0
63 getWrappedLine_remaining = me.text;
67 …if (me.allowColors) getWrappedLine((1 - me.keepspaceLeft - me.keepspaceRight), fs, draw_TextWidth_…
68 … else getWrappedLine((1 - me.keepspaceLeft - me.keepspaceRight), fs, draw_TextWidth_WithoutColors);
79 me.realOrigin_y = 0.5 * (1 - lines * me.realFontSize.y);
82 if (me.isBold) draw_endBoldFont();
84 me.recalcPos = 0;
86 …void Label_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absS…
88 SUPER(Label).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
91 me.realFontSize_y = absSize.y == 0 ? 0 : (me.fontSize / absSize.y);
92 me.realFontSize_x = absSize.x == 0 ? 0 : (me.fontSize / absSize.x);
93 if (me.marginLeft) me.keepspaceLeft = me.marginLeft * me.realFontSize.x;
94 if (me.marginRight) me.keepspaceRight = me.marginRight * me.realFontSize.x;
96 me.recalcPos = 1;
98 void Label_configureLabel(entity me, string txt, float sz, float algn)
100 me.fontSize = sz;
101 me.align = algn;
102 me.setText(me, txt);
104 void Label_draw(entity me)
108 if (me.disabled) draw_alpha *= me.disabledAlpha;
110 if (me.textEntity)
112 t = me.textEntity.toString(me.textEntity);
113 if (t != me.currentText)
115 if (me.currentText) strunzone(me.currentText);
116 me.currentText = strzone(t);
117 me.recalcPos = 1;
122 t = me.text;
125 if (me.recalcPos) me.recalcPositionWithText(me, t);
127 if (me.fontSize)
133 if (me.isBold) draw_beginBoldFont();
136 fs = me.realFontSize;
137 fs.x *= me.condenseFactor;
140 draw_fontscale.x *= me.condenseFactor;
142 if (me.allowCut) // FIXME allowCut incompatible with align != 0
144 …raw_Text(me.realOrigin, draw_TextShortenToWidth(t, (1 - me.keepspaceLeft - me.keepspaceRight), me.…
146 else if (me.allowWrap) // FIXME allowWrap incompatible with align != 0
149 o = me.realOrigin;
152 …if (me.allowColors) t = getWrappedLine((1 - me.keepspaceLeft - me.keepspaceRight), fs, draw_TextWi…
153 …else t = getWrappedLine((1 - me.keepspaceLeft - me.keepspaceRight), fs, draw_TextWidth_WithoutColo…
154 draw_Text(o, t, fs, me.colorL, me.alpha, me.allowColors);
155 o.y += me.realFontSize.y;
160 draw_Text(me.realOrigin, t, fs, me.colorL, me.alpha, me.allowColors);
165 if (me.isBold) draw_endBoldFont();
168 SUPER(Label).draw(me);