[lua]VTF Image Error on the Hud

Screen Shot

cl_hud



--> BackgoundBox
local Steel = Material("WolfHud_1/darksteel.vtf")
surface.SetMaterial( Steel )
surface.SetDrawColor( 255, 255, 255, 250)
surface.DrawTexturedRect( 0, ScrH() - 100,350,100)

sv_textures



if ( SERVER ) then
	resource.AddFile( "darksteel.vtf" )
end

Thanks!

you have to create your vmt, vtf it’s just a texture, but you have to show the material of it, so create the vmt and then load it without extension

And the vmt’s shader should be UnlitGeneric. Also, please don’t go around using


local Steel = Material("WolfHud_1/darksteel.vtf")

In a HUDPaint hook, just do that once OUTSIDE the hook to reduce pointless lag

Can i just use .PNG image it would be a lot easier

Yes you can, but for best quality, make sure it has power of 2 dimensions. ( Google it if you do not know what that means )

Ok i will do, Thanks

[editline]16th September 2016[/editline]

I have made the VMT file, now what do i do with it?

Just put it in the same file path your .VTF is in. Also, you literally just said you were going with PNG

Yeah ik i forgot i put that. xD

I have put the VMT in the same folder as the VTF and it still aint working

That’s strange… a PNG should work though