mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 12:01:47 +00:00
Create V_DrawCenteredSmallThinStringAtFixed() for new "small-thin-fixed-center" option in v.drawString()
Thankfully "center" is just "right" but with the X offset divided by 2.
This commit is contained in:
parent
f526cf2b4c
commit
8dbdb75abc
3 changed files with 13 additions and 1 deletions
|
|
@ -123,6 +123,7 @@ enum align {
|
||||||
align_smallright,
|
align_smallright,
|
||||||
align_smallthin,
|
align_smallthin,
|
||||||
align_smallthinfixed,
|
align_smallthinfixed,
|
||||||
|
align_smallthinfixedcenter,
|
||||||
align_smallthinfixedright,
|
align_smallthinfixedright,
|
||||||
align_thin,
|
align_thin,
|
||||||
align_thinfixed,
|
align_thinfixed,
|
||||||
|
|
@ -146,6 +147,7 @@ static const char *const align_opt[] = {
|
||||||
"small-right",
|
"small-right",
|
||||||
"small-thin",
|
"small-thin",
|
||||||
"small-thin-fixed",
|
"small-thin-fixed",
|
||||||
|
"small-thin-fixed-center",
|
||||||
"small-thin-fixed-right",
|
"small-thin-fixed-right",
|
||||||
"thin",
|
"thin",
|
||||||
"thin-fixed",
|
"thin-fixed",
|
||||||
|
|
@ -786,6 +788,9 @@ static int libd_drawString(lua_State *L)
|
||||||
case align_smallthinfixed:
|
case align_smallthinfixed:
|
||||||
V_DrawSmallThinStringAtFixed(x, y, flags, str);
|
V_DrawSmallThinStringAtFixed(x, y, flags, str);
|
||||||
break;
|
break;
|
||||||
|
case align_smallthinfixedcenter:
|
||||||
|
V_DrawCenteredSmallThinStringAtFixed(x, y, flags, str);
|
||||||
|
break;
|
||||||
case align_smallthinfixedright:
|
case align_smallthinfixedright:
|
||||||
V_DrawRightAlignedSmallThinStringAtFixed(x, y, flags, str);
|
V_DrawRightAlignedSmallThinStringAtFixed(x, y, flags, str);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -2885,6 +2885,12 @@ void V_DrawSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void V_DrawCenteredSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string)
|
||||||
|
{
|
||||||
|
x -= V_SmallThinStringWidth(string, option)/4;
|
||||||
|
V_DrawSmallThinStringAtFixed(x, y, option, string);
|
||||||
|
}
|
||||||
|
|
||||||
void V_DrawRightAlignedSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string)
|
void V_DrawRightAlignedSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string)
|
||||||
{
|
{
|
||||||
x -= V_SmallThinStringWidth(string, option)/2;
|
x -= V_SmallThinStringWidth(string, option)/2;
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,8 @@ void V_DrawRightAlignedThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, con
|
||||||
|
|
||||||
// draw a string using the tny_font at fixed_t coordinates, 0.5x scale
|
// draw a string using the tny_font at fixed_t coordinates, 0.5x scale
|
||||||
void V_DrawSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string);
|
void V_DrawSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string);
|
||||||
void V_DrawRightAlignedSmallThinStringAtFixed(INT32 x, INT32 y, INT32 option, const char *string);
|
void V_DrawCenteredSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string);
|
||||||
|
void V_DrawRightAlignedSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string);
|
||||||
|
|
||||||
// Draw tall nums, used for menu, HUD, intermission
|
// Draw tall nums, used for menu, HUD, intermission
|
||||||
void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num);
|
void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue