Preferred way of scaling hires HUD sprites?

Ask about mapping, UDMF, using DoomBuilder/editor of choice, etc, here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Post Reply
User avatar
gwHero
Posts: 360
Joined: Mon May 08, 2017 3:23 am
Graphics Processor: Intel with Vulkan/Metal Support
Location: The Netherlands

Preferred way of scaling hires HUD sprites?

Post by gwHero »

Does somebody know what the preferred way of scaling hi-res HUD sprites is?

I know it can be done with a Textures lump as well as with the hires folder, but the wiki is not quite clear about it.
The hi-res folder solution looks easier to use, but if it's a deprecated solution I would like to know that.

Thanks in advance.
User avatar
TensorMatrix
Posts: 41
Joined: Wed Mar 29, 2017 7:05 am

Re: Preferred way of scaling hires HUD sprites?

Post by TensorMatrix »

Do you use .pk3 or WAD format?

If .pk3, create a folder named "graphics" and put all HUD graphics in there. Then add these lines into TEXTURES lump:

Code: Select all

graphic hudleft, 196, 34
{
xscale 2
yscale 2
patch hudleft, 0, 0
}
Numbers after the graphic's name are width and height respectively, set them same as the graphic file. Xscale and Yscale scales the graphic; a value of 2 makes it twice smaller (this can be used to scale down hires images) and 0.5 makes it twice as big. Numbers after the graphic's name in the second last line are the x-origin and y-origin, i don't know much use for these in hud graphics so they can be left as zero.
User avatar
gwHero
Posts: 360
Joined: Mon May 08, 2017 3:23 am
Graphics Processor: Intel with Vulkan/Metal Support
Location: The Netherlands

Re: Preferred way of scaling hires HUD sprites?

Post by gwHero »

TensorMatrix wrote:Do you use .pk3 or WAD format?
I use a pk3 (i don't use the wad format anymore except sometimes for small quick tests)
TensorMatrix wrote:If .pk3, create a folder named "graphics" and put all HUD graphics in there. Then add these lines into TEXTURES lump:

Code: Select all

graphic hudleft, 196, 34
{
xscale 2
yscale 2
patch hudleft, 0, 0
}
Numbers after the graphic's name are width and height respectively, set them same as the graphic file. Xscale and Yscale scales the graphic; a value of 2 makes it twice smaller (this can be used to scale down hires images) and 0.5 makes it twice as big. Numbers after the graphic's name in the second last line are the x-origin and y-origin, i don't know much use for these in hud graphics so they can be left as zero.
Thank you for the reply, I have been struggling with this quite some time.
Could not get it right with the Textures solution only and the graphic folder; maybe because I still did something wrong or maybe because what I wanted was a bit too complicated (I wanted to scale down the original graphics with factor 5, and vertically with 6 to compensate the default GZDoom 1.2 pixelratio, and also needed some offset refinements for animations).

So finally I have implemented a 2-way solution:
- added the higher resolution sprites to the folder hires;
- added dummy sprites to the sprites folder with dimensions scaled down by 5;
- added a Textures lump like in your example to do to the final offsets and pixelratio compensation, and this works! (even tested with several screen resolutions, so I'm happy :) )

Code: Select all

sprite HMUGD0, 36, 42 {	offset -142, -157	YScale 1.2 }
sprite HMUGE0, 36, 42 { offset -140, -159	YScale 1.2 }
Post Reply

Return to “Mapping”