A.
void DrawText2 (int X, int Y, Color2 Color2, int Font, bool Center, const char * _Input, ...)
{
int apple = 0;
/ * set up buffer * /
char Buffer [2048] = {'\ 0'};
/ * set up varargs * /
va_list Args;
va_start (Args, _Input);
vsprintf_s (Buffer, _Input, Args);
va_end (Args);
size_t Size = strlen (Buffer) + 1;
/ * set up widebuffer * /
wchar_t * WideBuffer = new wchar_t [Size];
/ * char -> wchar * /
mbstowcs_s (0, WideBuffer, Size, Buffer, Size - 1);
/ * check center * /
int Width = 0, Height = 0;
if (Center)
{
GetTextSize (Font, WideBuffer, Width, Height);
}
/ * call and draw * /
DrawSetTextColor2 (Color2.red, Color2.green, Color2.blue, Color2.alpha);
DrawSetTextFont (Font);
DrawSetTextPos (X - (Width / 2), Y);
DrawPrintText (WideBuffer, wcslen (WideBuffer));
return
}
[/ code]
hq