Black spot in custom hud.

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
SweatyDevil
Posts: 7
Joined: Thu Aug 28, 2025 3:39 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10

Black spot in custom hud.

Post by SweatyDevil »

I'm trying to fix an issue, where my custom sbarinfo, causing black spot in the left upper corner, as you can see on this pic:

https://imgur.com/a/FqXqDms

The situation is that the sbarinfo code is functioning correctly, and the graphics are fine too. The entire HUD works as intended, without any errors or bugs. However, due to the way GZDoom handles upscaling or offsetting, it results in a black spot in the upper left corner. I tried tweaking the code, disabling lines one by one with // to see if something specific in the script was causing the problem. I even attempted to convert and alpha edit the graphics lumps, but it didn’t help. No matter what I try, the black spot continues to appear. I wrote the coordinates both with + center and without it, but that didn’t change anything. Deleting either forcescaled or fullscreenoffsets didn’t fix the problem either; it just messed up the HUD. Is there anything I can do to resolve this? :( I'm using the latest version of gzdoom 4.14.2.

Code: Select all

StatusBar Normal, forcescaled | fullscreenoffsets 
{
	DrawImage "STBARL", -240 + center, -43;
	DrawImage "STBARR", 90 + center, -43;

    DrawBar "HPBR1", "HPBAREMPTY", Health, vertical, interpolate(10), 208 + center, -36;
	
	DrawImage "BAROVER", 208 + center, -43;
	
	DrawImage "HLCRS", 213 + center, -33;

	DrawBar "MPBAR1", "MPBAREMPTY", Ammo PSMana, vertical, interpolate(10), -235 + center, -36;
	
	DrawImage "BAROVER", -235 + center, -43;
	
    IfWaterLevel 3
    {
        InInventory AirHUD, 9 { DrawImage "LNGSFIL9", -166 + center, -19; }
        Else InInventory AirHUD, 8 { DrawImage "LNGSFIL8", -166 + center, -20; }
        Else InInventory AirHUD, 7 { DrawImage "LNGSFIL7", -166 + center, -20; }
        Else InInventory AirHUD, 6 { DrawImage "LNGSFIL6", -166 + center, -20; }
        Else InInventory AirHUD, 5 { DrawImage "LNGSFIL5", -166 + center, -20; }
        Else InInventory AirHUD, 4 { DrawImage "LNGSFIL4", -166 + center, -20; }
        Else InInventory AirHUD, 3 { DrawImage "LNGSFIL3", -166 + center, -20; }
        Else InInventory AirHUD, 2 { DrawImage "LNGSFIL2", -166 + center, -20; }
        Else InInventory AirHUD, 1 { DrawImage "LNGSFIL1", -166 + center, -20; }
    }
    Else
    {
        DrawImage "LGIDL1", -166 + center, -20;
    }
	
	InInventory Power12	{ DrawImage "PWIC", 102 + center, -18; }
	InInventory Time11	{ DrawImage "TMIC", 121 + center, -19; }
	InInventory War10	{ DrawImage "WRIC", 138 + center, -18; }
	InInventory Earth13	{ DrawImage "EAIC", 158 + center, -19; }
		
	InventorybarNotVisible 
	{
		DrawSelectedInventory center, AlwaysShowCounter, BigFont, 18, -21, 36, -33;
	}
		
	DrawNumber 3, AMMOFONT, Untranslated, Ammo1, fillzeros, interpolate(10), -104 + center, -19, 1;
}

User avatar
phantombeta
Posts: 2186
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: Black spot in custom hud.

Post by phantombeta »

That's caused by a missing background image in a DrawBar. "HPBAREMPTY" and "MPBAREMPTY" have more than 8 characters in their filenames, so GZDoom won't find them unless you use their full path, or rename them so they fit the 8 character limit.
User avatar
SweatyDevil
Posts: 7
Joined: Thu Aug 28, 2025 3:39 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10

Re: Black spot in custom hud.

Post by SweatyDevil »

I followed your suggestion, but unfortunately, it didn't work. The black box is still present :(

Code: Select all

StatusBar Normal, forcescaled | fullscreenoffsets 
{
	DrawImage "STBARL", -240 + center, -43;
	DrawImage "STBARR", 90 + center, -43;

    DrawBar "HPBR", "HBMT", Health, vertical, interpolate(10), 208 + center, -36;
	
	DrawImage "BAROVER", 208 + center, -43;
	
	DrawImage "HLCRS", 213 + center, -33;

	DrawBar "MPBR", "MBMT", Ammo PSMana, vertical, interpolate(10), -235 + center, -36;
	
	DrawImage "BAROVER", -235 + center, -43;
	
    IfWaterLevel 3
    {
        InInventory AirHUD, 9 { DrawImage "LNGSFIL9", -166 + center, -19; }
        Else InInventory AirHUD, 8 { DrawImage "LNGSFIL8", -166 + center, -20; }
        Else InInventory AirHUD, 7 { DrawImage "LNGSFIL7", -166 + center, -20; }
        Else InInventory AirHUD, 6 { DrawImage "LNGSFIL6", -166 + center, -20; }
        Else InInventory AirHUD, 5 { DrawImage "LNGSFIL5", -166 + center, -20; }
        Else InInventory AirHUD, 4 { DrawImage "LNGSFIL4", -166 + center, -20; }
        Else InInventory AirHUD, 3 { DrawImage "LNGSFIL3", -166 + center, -20; }
        Else InInventory AirHUD, 2 { DrawImage "LNGSFIL2", -166 + center, -20; }
        Else InInventory AirHUD, 1 { DrawImage "LNGSFIL1", -166 + center, -20; }
    }
    Else
    {
        DrawImage "LGIDL1", -166 + center, -20;
    }
	
	InInventory Power12	{ DrawImage "PWIC", 102 + center, -18; }
	InInventory Time11	{ DrawImage "TMIC", 121 + center, -19; }
	InInventory War10	{ DrawImage "WRIC", 138 + center, -18; }
	InInventory Earth13	{ DrawImage "EAIC", 158 + center, -19; }
		
	InventorybarNotVisible 
	{
		DrawSelectedInventory center, AlwaysShowCounter, BigFont, 18, -21, 36, -33;
	}
		
	DrawNumber 3, AMMOFONT, Untranslated, Ammo1, fillzeros, interpolate(10), -104 + center, -19, 1;
}

https://imgur.com/a/RDiKH9o
User avatar
phantombeta
Posts: 2186
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: Black spot in custom hud.

Post by phantombeta »

I forgot to mention, they also need to be the same size as the "foreground" bar image. That's the only other thing I know of that could cause this problem.
User avatar
SweatyDevil
Posts: 7
Joined: Thu Aug 28, 2025 3:39 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10

Re: Black spot in custom hud.

Post by SweatyDevil »

phantombeta wrote: Fri Sep 05, 2025 10:11 am I forgot to mention, they also need to be the same size as the "foreground" bar image. That's the only other thing I know of that could cause this problem.
Holly mother of sweet biscuits, that did it! The HBMT and MBMT were 2 bloody pixels bigger than the bar image. TWO bloody pixels gave me headache for three days straight. Two bloody pixels... ARHG!! I can't thank you enough for helping me out with this. Thank you so much, mate. :D

Return to “Scripting”