Moderator: GZDoom Developers
ui void drawTextCenter(string text, int color, double scale, double relativeY,
Font font, int xAdjustment = 0)
{
int width = int(scale * Screen.GetWidth());
int height = int(scale * (Screen.GetHeight() - font.GetHeight()));
int position = width - font.StringWidth(text);
double x = position * 0.5 + xAdjustment;
double y = height * relativeY;
Screen.DrawText(font, color, x, y, text,
DTA_KeepRatio, true,
DTA_VirtualWidth, width,
DTA_VirtualHeight, height);
}
Matt wrote:Can we reopen this feature suggestion?
Nash wrote:m8f - what are "xAdjustment" and "relativeY" supposed to mean?
Spoiler: If we're talking status bars...
Major Cooke wrote:It's set up where scaling works as a multiplier so 2 is twice as big and so on.
I don't like breaking the abstraction unless really necessary, so I kind of wonder why DrawString shouldn't have a scale parameter when DrawImage and co. already have it.
Return to Closed Feature Suggestions
Users browsing this forum: No registered users and 0 guests