Page 1 of 1

In-game images full scalling

Posted: Sat Aug 18, 2012 10:12 pm
by SuperToaster
Just wondering, nearly every game, even not so modern got this feature to display any image in-game and scale it to player's monitor resolution.

Howewer both in ZDoom/GZDoom and Zandronum i never saw full image scalling. And that's really sad because when i for example make first person helmet graphics for player i got it cuted in widescreen resolution or at any resolutions which are somehow wider. And alot of mods, as i know, are suffering from same issue - they huds or, for example, blood screen graphics looks horrible on screens with wider resolution.

Right now images can be displayed with their original resolution via Hudmessage or they can be scaled in height with HUD(SBARINFO).

Returning to other games, they always got in their resources original image which resolution depends only on what quality game's artists want it to have and i find this way really good. While in ZDoom/Zandronum we must suffer from making graphics for some resolution which will look ugly on all others.

I don't really suggest anything right now, as i don't know if it could be even possible and that's more like a question : can it be made anyhow to add full image scalling both in Hudmessage (via some flag or parametre) and in HUD (too maybe with some parametre)?

RE: In-game images full scalling

Posted: Sat Aug 18, 2012 10:39 pm
by Ijon Tichy
hud_scale 1

also it's completely up to the creator of the ACS to include SetHudSize in his scripts (which will get what you want) - I always do, but it's pretty common for someone not to

RE: In-game images full scalling

Posted: Sat Aug 18, 2012 10:41 pm
by Ænima
http://zdoom.org/wiki/SetHudSize usually does the job. Except for SBARINFO. That's still problematic when it comes to scaling at different resolutions.

EDIT:
Ijon ninja'd my post.

RE: In-game images full scalling

Posted: Sat Aug 18, 2012 11:34 pm
by SuperToaster
Ah, i was thinking that SetHudSize is just for setting coordinates of image placement. Okay, but wiki says that it work only on 4:3 resolutions. So on widescreen monitors this issue is still present?

RE: In-game images full scalling

Posted: Sat Aug 18, 2012 11:41 pm
by Ijon Tichy
no, it means it won't compensate for non-4:3 ratios (read: it won't stretch coordinates for widescreen monitors)

RE: In-game images full scalling

Posted: Sat Aug 18, 2012 11:51 pm
by SuperToaster
Ok, i get it. Thanks for replies, that's a really handy information.

RE: In-game images full scalling

Posted: Sun Aug 19, 2012 12:47 pm
by SuperToaster
Hmm, i tested it. But it doesn't seem to work. How do you actually scale image with SetHudSize? I setted it with GetScreenHeight and GetScreenWidth and in HudMessage x and y i changed for 0.5,0.1 (i tried setting resolution/2<<16+0.4 but that didn't work as well). And all i get is that image is now on left edge - no scalling at all...

RE: In-game images full scalling

Posted: Thu Aug 23, 2012 11:47 pm
by Ijon Tichy

Code: Select all

SetHudSize(640, 480, 1) ;            // all images are scaled so that they look proportional
int width  = GetScreenWidth << 16;   // to what they do on a 640x480 screen - 1 means "include
int height = GetScreenHeight << 16;  // the hud in the SetHudSize"

SetFont("PICFONT");

HudMessage(s:"A"; HUDMSG_PLAIN, 2321, CR_UNTRANSLATED, (width/2) + 0.4, (height/2), 10.0);