Silkicon problem

When I add the Heart silkicon to my hud it ethier comes out full black “Without the surface.SetDrawColor Line in the code” but when I add the setdrawcolor It comes out blood red instead of coming out looking like the normal silkicon Anyone know how to get it back to the normal colored silkicon heart?

[lua]surface.SetDrawColor( 255, 0, 0, 255 );
surface.DrawTexturedRect(15 + 4,ScrH() - 80,16,16)[/lua]

surface.SetDrawColor( 255, 255, 255, 255 )

Because you’re drawing it red. I suggest learning what the code actually does instead of just copy/pasting things.

Thank you, Also I made a Health bar that sits ontop of a gray box that sits at the bottom of your screen
The only problem is they overlay each other “The red box and the gray will mix instead of a no transparency red health bar ontop of a no transperency gray bar”

[lua]draw.RoundedBox(0, 12, ScrH() - 4 - 15, health, 15, Color(255,0,0,255))
draw.RoundedBox(0, 0, ScrH() - 17, 4000, 33, Color( 0, 0, 0, 140 ) )[/lua]

Fourth value is alpha. Any value less than 255 is not solid, and will alpha blend into whatever is beneath it.

Good christ are you stupid?
Use solid colors instead of low transparencies. Learn what the color object is. LEARN THE CODE.
A solid gray box would be something like Color(100,100,100,255)

Take your anger somewhere else please.

Infact, as far as I got that he pretty much just started with coding and as you MAYBE know yourself that there is a lot of confusing stuff at the beginning…

Do not use the ‘surface.GetTextureID’ function inside the drawing function.

The way he’s trying to code is wrong though. Instead of learning what a function does and what its parameters mean, he just pastes semi-related stuff he can find in there. If you don’t do that, you get situations like this where you pasted a function call with magic numbers and then complain it doesn’t work.

On topic, you also have to flip the health bar draw functions. If you want the red on top, it has to draw after.

Why do you have the gray box at 4000 width?