void draw_reset(float cw, float ch, float ox, float oy)
{
- drawfont = FONT_USER+0;
draw_shift = '1 0 0' * ox + '0 1 0' * oy;
draw_scale = '1 0 0' * cw + '0 1 0' * ch;
draw_alpha = 1;
draw_fontscale = '1 1 0';
+ draw_endBoldFont();
+}
+
+void draw_beginBoldFont()
+{
+ drawfont = FONT_USER+3;
+}
+
+void draw_endBoldFont()
+{
+ drawfont = FONT_USER+0;
}
vector globalToBox(vector v, vector theOrigin, vector theScale)
}
void draw_Text(vector theOrigin, string theText, vector theSize, vector theColor, float theAlpha, float ICanHasKallerz)
{
- if(theSize_x <= 0 || theSize_y <= 0)
- error("Drawing zero size text?\n");
+ if(theSize_x <= 0 || theSize_y <= 0) {
+ dprint("Drawing zero size text?\n");
+ return;
+ }
//float wi;
//wi = draw_TextWidth(theText, ICanHasKallerz, theSize);
return v_x;
}
+float draw_CondensedFontFactor(string theText, float ICanHasKallerz, vector SizeThxBye, float maxWidth)
+{
+ float w = draw_TextWidth(theText, ICanHasKallerz, SizeThxBye);
+ if (w > maxWidth) {
+ //dprintf("NOTE: label text %s too wide for label, condensed by factor %f\n", theText, maxWidth / w);
+ return maxWidth / w;
+ }
+ return 0.8;
+}
+
float draw_clipSet;
void draw_SetClip()
{