MCPcopy Create free account
hub / github.com/JACoders/OpenJK / Text_Paint

Function Text_Paint

code/ui/ui_main.cpp:619–647  ·  view source on GitHub ↗

================ Text_Paint ================ */ iMaxPixelWidth is 0 here for no limit (but gets converted to -1), else max printable pixel width relative to start pos

Source from the content-addressed store, hash-verified

617// iMaxPixelWidth is 0 here for no limit (but gets converted to -1), else max printable pixel width relative to start pos
618//
619void Text_Paint(float x, float y, float scale, vec4_t color, const char *text, int iMaxPixelWidth, int style, int iFontIndex)
620{
621 if (iFontIndex == 0)
622 {
623 iFontIndex = uiInfo.uiDC.Assets.qhMediumFont;
624 }
625 // kludge.. convert JK2 menu styles to SOF2 printstring ctrl codes...
626 //
627 int iStyleOR = 0;
628 switch (style)
629 {
630// case ITEM_TEXTSTYLE_NORMAL: iStyleOR = 0;break; // JK2 normal text
631// case ITEM_TEXTSTYLE_BLINK: iStyleOR = STYLE_BLINK;break; // JK2 fast blinking
632 case ITEM_TEXTSTYLE_PULSE: iStyleOR = STYLE_BLINK;break; // JK2 slow pulsing
633 case ITEM_TEXTSTYLE_SHADOWED: iStyleOR = STYLE_DROPSHADOW;break; // JK2 drop shadow ( need a color for this )
634 case ITEM_TEXTSTYLE_OUTLINED: iStyleOR = STYLE_DROPSHADOW;break; // JK2 drop shadow ( need a color for this )
635 case ITEM_TEXTSTYLE_OUTLINESHADOWED: iStyleOR = STYLE_DROPSHADOW;break; // JK2 drop shadow ( need a color for this )
636 case ITEM_TEXTSTYLE_SHADOWEDMORE: iStyleOR = STYLE_DROPSHADOW;break; // JK2 drop shadow ( need a color for this )
637 }
638
639 ui.R_Font_DrawString( x, // int ox
640 y, // int oy
641 text, // const char *text
642 color, // paletteRGBA_c c
643 iStyleOR | iFontIndex, // const int iFontHandle
644 !iMaxPixelWidth?-1:iMaxPixelWidth, // iMaxPixelWidth (-1 = none)
645 scale // const float scale = 1.0f
646 );
647}
648
649
650/*

Callers 3

Text_PaintWithCursorFunction · 0.70
UI_DrawKeyBindStatusFunction · 0.70
UI_DrawGLInfoFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected