• HUD Problem
    8 replies, posted
Hey, I get this error with my HUD: [img]http://img651.imageshack.us/img651/3356/hudproblem.jpg[/img] Here is my code: [lua]function textures() local heart = surface.GetTextureID( "hud/hudheart.vtf" ) surface.SetDrawColor( 255, 255, 255, 255 ); surface.SetTexture( heart ); surface.DrawTexturedRect( ScrW() * 0.25, ScrH() * 0.90, ScrW() / 25, ScrH() / 25 ); end hook.Add( "HUDPaint", "textures", textures )[/lua] Can someone help me please? Also: -Yes, it is the correct name -I tried using hud/hudheart.vtf
What should it look like?
[QUOTE=|King Flawless|;21546799]What should it look like?[/QUOTE] A orange heart.
It looks like it's a problem with the texture itself.
[QUOTE=CowThing;21547207]It looks like it's a problem with the texture itself.[/QUOTE] When I draw the texture on the screen, do I have to size it to the exact size the image is? Example: The image is 16x16 Do I have to do draw.TexturedRect and make it so it is 16x16?
It would be best if you drew it at it's original size, also it looks like you might be using the wrong shader for the material.
[QUOTE=CowThing;21547526]It would be best if you drew it at it's original size, also it looks like you might be using the wrong shader for the material.[/QUOTE] What do you mean wrong shader?
In the material file(VMT), which is a text file, you can use different shaders such as "LightmappedGeneric" or "UnlitGeneric" which affect how the material is seen. For HUD items UnlitGeneric would be the best to use.
[QUOTE=CowThing;21547627]In the material file(VMT), which is a text file, you can use different shaders such as "LightmappedGeneric" or "UnlitGeneric" which affect how the material is seen. For HUD items UnlitGeneric would be the best to use.[/QUOTE] Oh ok. I will remember that, thanks. But I got another problem I'm figuring out.
Sorry, you need to Log In to post a reply to this thread.