Can someone explain how it works with the float XY and ScaleXY? I do not really understand that
DISCORD: xexghosted
(03-15-2019 - 04:37 PM)Justtestingit Wrote: Its very simple kinda self explanatory...float x and float y are the position on the screen for example if x and y are set equal to 0.5f the text will be in the center of the screen.
float scaleX and float scaleY are the scale/size of the text
even you only know basic c++ it would take very little time and effort to work that out
void drawStr(const char *str, float x, float y, float fontSize, float *color, char *font) {
R_AddCmdDrawText(str, 0x7FFFFFFF, R_RegisterFont(font, 0), x, y, fontSize, fontSize, 0, color, 0);
}
drawStr("My Awesome String", 1280 / 2 - 140, 720 / 2 - 360, 0.65, colWhite, "fonts/smallFont");
(03-15-2019 - 11:00 PM)Dread Wrote: So their's your area to work with, by default COD's max res is 1280x720:
Width (x): 1280
Height (y): 720
The way you're writing that function, is a little over-done imo.
You could simplify it to something like:
Code:void drawStr(const char *str, float x, float y, float fontSize, float *color, char *font) {
R_AddCmdDrawText(str, 0x7FFFFFFF, R_RegisterFont(font, 0), x, y, fontSize, fontSize, 0, color, 0);
}
Usage:
Code:drawStr("My Awesome String", 1280 / 2 - 140, 720 / 2 - 360, 0.65, colWhite, "fonts/smallFont");
Hope this gave some extra insight :)