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.

Scale down a high res HUD weapon sprite?

Postby Nash » Tue Mar 20, 2012 7:11 am

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?
User avatar
Nash
Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: Scale down a high res HUD weapon sprite?

Postby Gez » Tue Mar 20, 2012 7:23 am

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

You'll have to use TEXTURES to resize these sprites.
Gez
 
 
 
Joined: 06 Jul 2007

Re: Scale down a high res HUD weapon sprite?

Postby Jekyll Grim Payne » Wed Mar 21, 2012 2:43 pm

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 allExpand view
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
Jekyll Grim Payne
 
Joined: 21 Jul 2008
Discord: Agent_Ash#4401
Github ID: jekyllgrim
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

Re: Scale down a high res HUD weapon sprite?

Postby Nash » Wed Mar 21, 2012 2:47 pm

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.
User avatar
Nash
Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: Scale down a high res HUD weapon sprite?

Postby Gez » Wed Mar 21, 2012 2:57 pm

You have the possibly simpler alternative of using placeholder sprites in the sprites namespace, and the real ones in the hires namespace. Then the scaling is done automatically without having to create a TEXTURE lump.
Gez
 
 
 
Joined: 06 Jul 2007

Re: Scale down a high res HUD weapon sprite?

Postby Enjay » Wed Mar 21, 2012 2:59 pm

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?
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Scale down a high res HUD weapon sprite?

Postby Gez » Wed Mar 21, 2012 3:03 pm

To say nothing about TEXTUREx scaling which works in a third different way....
Gez
 
 
 
Joined: 06 Jul 2007

Re: Scale down a high res HUD weapon sprite?

Postby Enjay » Wed Mar 21, 2012 3:11 pm

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.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Scale down a high res HUD weapon sprite?

Postby Gez » Wed Mar 21, 2012 3:22 pm

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).
Gez
 
 
 
Joined: 06 Jul 2007

Re: Scale down a high res HUD weapon sprite?

Postby NeuralStunner » Wed Mar 21, 2012 3:34 pm

It would be nice to have new scaling properties and have the old ones deprecated. I hate the ass-backwards system.
User avatar
NeuralStunner
not actually a catgirl
 
 
 
Joined: 21 Jul 2009
Location: =o_O=
Discord: NeuralStunner#1293
Operating System: Windows Vista/7/2008 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: Scale down a high res HUD weapon sprite?

Postby GraveUypo » Sun Oct 22, 2017 7:23 pm

Gez wrote:You have the possibly simpler alternative of using placeholder sprites in the sprites namespace, 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.
User avatar
GraveUypo
 
Joined: 03 Jun 2017


Return to Assets (and other stuff)

Who is online

Users browsing this forum: No registered users and 0 guests