(adsbygoogle = window.adsbygoogle || []).push({});
So ive been trying to get the width of a text so i can do whatever i want with it but it doesn't work
my func looks something like this:
struct Font_s
{
int fontName;
float pixelHeight;
int glyphCount;
int material;
int glowMaterial;
int glyphs;
};
void*(*R_RegisterFont)(const char * font, int imageTrac)
int (*R_TextWidth)(const char *text, int maxChars, Font_s *font)
Font_s* (*R_NormalizedTextScale)(void *font, float scale) //This is actually a float
float GetTextWidth(const char *Text, const char *font, float scale)
{
return (float)R_TextWidth(Text, sizeof(Text), R_NormalizedTextScale(R_RegisterFont(font, 0), scale);
}
plz help
btw the game calls it like this:
R_TextWidth(Text, sizeof(Text), UI_GetFontHandle(scr, font, scale));
but i dont want to use scr or any UI_ func cause theyre annoying.