[question] Using TEXTURES to render HUD sprites

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
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.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
User avatar
Dr_Cosmobyte
Posts: 2860
Joined: Thu Jun 04, 2015 9:07 pm
Preferred Pronouns: He/Him
Location: Killing spiders.

[question] Using TEXTURES to render HUD sprites

Post by Dr_Cosmobyte »

Sorry if i shouldn't create another thread to another question, but i just would like to solve a rather annoying problem.

I am using TEXTURES to make an akimbo. The thing is, the left sprite (which is a mirrored version of the right one) gets cut out during the fire animation, which is totally weird. During the idle animation, both are alright. The right one has defined offsets instead of textures.

Here's an example of the bug, and below it, an example of the code.


Code: Select all

Sprite WL3FA0, 320, 200
{
	Patch WR3FA0, -38, 58
	{
		FlipX
	}
}

Sprite WL3FB0, 320, 200
{
	Patch WR3FB0, -42, 58
	{
		FlipX
	}
}

Sprite WL3FC0, 320, 200
{
	Patch WR3FC0, -46, 64
	{
		FlipX
	}
}

Sprite WL3FD0, 320, 200
{
	Patch WR3FD0, -54, 74
	{
		FlipX
	}
}

Sprite WL3FE0, 320, 200
{
	Patch WR3FE0, -58, 70
	{
		FlipX
	}
}

Sprite WL3FF0, 320, 200
{
	Patch WR3FF0, -54, 66
	{
		FlipX
	}
}

Sprite WL3FG0, 320, 200
{
	Patch WR3FG0, -50, 64
	{
		FlipX
	}
}

Sprite WL3FH0, 320, 200
{
	Patch WR3FH0, -31, 77
	{
		FlipX
	}
}
Thanks in advance!
User avatar
wildweasel
Posts: 21705
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed

Re: [question] Using TEXTURES to render HUD sprites

Post by wildweasel »

Your Textures canvas is 320x200 but your screenshot is in a widescreen mode. Is the Textures canvas large enough to accommodate its patch being moved?
User avatar
Dr_Cosmobyte
Posts: 2860
Joined: Thu Jun 04, 2015 9:07 pm
Preferred Pronouns: He/Him
Location: Killing spiders.

Re: [question] Using TEXTURES to render HUD sprites

Post by Dr_Cosmobyte »

I tried using my resolution as of now (1366, 768) instead of the said canvas, but the problem persists. I've also tried to change the "force aspect ratio", from "none" to my resolution (i believe it's 16:9?) So i got no results. =s
User avatar
wildweasel
Posts: 21705
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed

Re: [question] Using TEXTURES to render HUD sprites

Post by wildweasel »

What are you using to edit your Textures lump? If you're not already using SLADE's built-in texture editor you should try it.
User avatar
Dr_Cosmobyte
Posts: 2860
Joined: Thu Jun 04, 2015 9:07 pm
Preferred Pronouns: He/Him
Location: Killing spiders.

Re: [question] Using TEXTURES to render HUD sprites

Post by Dr_Cosmobyte »

Forgive my ignorance. I always thought that function was made for mapping, and i never made no more than a open hall, so i never gave a go on it.

Actually, the only way i did it all the time was creating a lump, naming it textures, applied some math in and calculated the offsets by brain.

Thanks for the tip!
User avatar
wildweasel
Posts: 21705
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed

Re: [question] Using TEXTURES to render HUD sprites

Post by wildweasel »

SLADE's Textures editor is handy to help visualize the more complicated arrangements, especially in regards to the canvas. Very useful to figure out why the graphic is cutting off, etc.

Return to “Scripting”