Proper scaling parameter for Status Bar functions

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Proper scaling parameter for Status Bar functions

Post by Major Cooke »

From what I've been told on Discord, only 320 x 200 for a base size will allow for the option menu's hud scaling to have any effect. Unfortunately for D4D, in order to make the credit numbers and the likes visible, I have to rely upon doubling the size via a hacky method in order to change its size.

Code: Select all

// Uniform scaling.
void DrawStringScaled(HUDFont font, String string, Vector2 pos, int flags = 0, int translation = Font.CR_UNTRANSLATED, double Alpha = 1., int wrapwidth = -1, int linespacing = 4, double scaling = 1.0)
{
	Vector2 OldScale = BaseSize, TempScale = BaseSize;
	Vector2 ScaledPos = pos;
	
	if (scaling == 0.0)
		return;
	
	scaling = abs(scaling);
	
	bool sized = (scaling != 1.0);
	if (sized)
	{
		TempScale /= scaling;
		ScaledPos /= scaling;
	}
	
	if (sized) SetSize(0, TempScale.X, TempScale.Y);
	DrawString(font, string, ScaledPos, flags, translation, Alpha, wrapwidth, linespacing);
	if (sized) SetSize(0, OldScale.X, OldScale.Y);
	
}
Which means I have to throw the ability to scale this properly out the window for now since the base size is 1024 x 768.
Accensus
Posts: 2383
Joined: Thu Feb 11, 2016 9:59 am

Re: Proper scaling parameter for Status Bar functions

Post by Accensus »

Ackchyually, HUD scaling does work on different base size. Only difference is that it'll only have any effect on higher scaling, such as 5 and above. That's what I recall from my past clashes with HUD size and scaling.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: Proper scaling parameter for Status Bar functions

Post by wildweasel »

I'll be honest, I feel like HUD scaling - especially via ZScript - is a bit of a mess at the moment. So much of what makes HUDs work, currently relies on them being to scale with the original Doom HUD, with little accounting for anything designed for a higher resolution. I'm currently struggling with aspect ratio, myself, and I'm wondering if I need to request some method to force a status bar to ignore the "adjust to aspect ratio" setting.
Post Reply

Return to “Feature Suggestions [GZDoom]”