Scale down a high res HUD weapon sprite?

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderators: GZDoom Developers, Raze 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
Nash
 
 
Posts: 17429
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Scale down a high res HUD weapon sprite?

Post by Nash »

I have a first person weapon sprite which is 2 times larger than the vanilla Doom sprite resolution (it fills a 640 x 400) screen and I want to scale it down.

I tried putting "Scale 0.5" in the weapon definition in DECORATE but it's not scaling down.

Help?
Gez
 
 
Posts: 17831
Joined: Fri Jul 06, 2007 3:22 pm

Re: Scale down a high res HUD weapon sprite?

Post by Gez »

That'll only scale the world sprites (the weapon pickup), not the HUD sprites...

You'll have to use [wiki]TEXTURES[/wiki] to resize these sprites.
User avatar
Jekyll Grim Payne
 
 
Posts: 1063
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)
Contact:

Re: Scale down a high res HUD weapon sprite?

Post by Jekyll Grim Payne »

Nash wrote:I have a first person weapon sprite which is 2 times larger than the vanilla Doom sprite resolution (it fills a 640 x 400) screen and I want to scale it down.

I tried putting "Scale 0.5" in the weapon definition in DECORATE but it's not scaling down.

Help?
It's possible, but not via scale command. You have to create a TEXTURES lump and define EVERY sprite used like this:

Code: Select all

sprite RPGFD0, 640, 480
{
xscale 2
yscale 2
offset -9,71 //or what you need
patch RPGFA0, 0, 0 //simply the name of the sprite
}
Also mind you that a doom screen is not 320x200, it's 320x168 (minus 32 pixels for a status bar), so a dual scale sprite would be actually 640x336. I did this in one of my mods: http://www.doomworld.com/idgames/index.php?id=16336
User avatar
Nash
 
 
Posts: 17429
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Scale down a high res HUD weapon sprite?

Post by Nash »

I'm using 320 x 200 because my game has no HUD.

Also, it's a shame that offsets on the sprite lump itself are ignored when defining high res sprites this way.
Gez
 
 
Posts: 17831
Joined: Fri Jul 06, 2007 3:22 pm

Re: Scale down a high res HUD weapon sprite?

Post by Gez »

You have the possibly simpler alternative of using placeholder sprites in the sprites [wiki]namespace[/wiki], and the real ones in the hires namespace. Then the scaling is done automatically without having to create a TEXTURE lump.
User avatar
Enjay
 
 
Posts: 26508
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Scale down a high res HUD weapon sprite?

Post by Enjay »

Personally I think that its a shame that TEXTURES and DECORATE use different logic for their scaling factors. DECORATE using 0.5 to make something half its size and TEXTURES using 2 just seems odd to me. I wonder why it was done that way?
Gez
 
 
Posts: 17831
Joined: Fri Jul 06, 2007 3:22 pm

Re: Scale down a high res HUD weapon sprite?

Post by Gez »

To say nothing about [wiki]TEXTUREx[/wiki] scaling which works in a third different way....
User avatar
Enjay
 
 
Posts: 26508
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Scale down a high res HUD weapon sprite?

Post by Enjay »

True but isn't that something to do with the way the data needs to be stored in the TEXTUREx lump? I always assumed as much but now that you bring it up I realise that I have no sound reason for thinking that.
Gez
 
 
Posts: 17831
Joined: Fri Jul 06, 2007 3:22 pm

Re: Scale down a high res HUD weapon sprite?

Post by Gez »

Well, it's an integer value, so it made sense to use a base other than 1 for 1.0 so as to allow scalings like 2.5 (20); or in the other direction for a scale of 0.25 (2).
User avatar
NeuralStunner
 
 
Posts: 12325
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Scale down a high res HUD weapon sprite?

Post by NeuralStunner »

It would be nice to have new scaling properties and have the old ones deprecated. I hate the ass-backwards system.
User avatar
GraveUypo
Posts: 11
Joined: Sat Jun 03, 2017 6:20 pm

Re: Scale down a high res HUD weapon sprite?

Post by GraveUypo »

Gez wrote:You have the possibly simpler alternative of using placeholder sprites in the sprites [wiki]namespace[/wiki], and the real ones in the hires namespace. Then the scaling is done automatically without having to create a TEXTURE lump.
i love you. seriously this is so easy and solves the problem i was having perfectly, i had to login to thank this post.
if anyone googling for a solution and end ups here: it's this one.
Post Reply

Return to “Assets (and other stuff)”