Just: vgui::surface()->DrawSetColor(255, 255, 255, alpha); Should work.
Here's my .vmt: "UnlitGeneric" { "$basetexture" "hud\markers\marker_stopwatch_green" "$translucent" 1 "$no_fullbright" 1 "$ignorez" 1 "$nolod" 1 "$vertexalpha" 1 } vertexalpha and translucent might be the cause. Ensure those are correct. If that doesn't help, might be a problem with the .vtf itself. Maybe a setting wasn't set when creating it, but it's probably the former. Harry Jeffery wrote: > Hi, I'm working on a hud for my mod and I am having a lot of trouble > trying to get the elements to fade out. I am using textures to create > the hud which is working very well. They the alpha masks in their > textures just fine, what they refuse to do is allow me to change the > overall alpha in code. > > This is how I am using the textures. > > /////////////////////////////// > > //Initialisation > int m_nTexture; > m_nTexture = vgui::surface()->CreateNewTextureID(); > vgui::surface()->DrawSetTextureFile(m_nTexture, > "vgui/hud/texturename", true, false ); > > > //Paint() > vgui::surface()->DrawSetColor(GetFgColor()); > vgui::surface()->DrawSetTexture( m_nTexture ); > vgui::surface()->DrawTexturedRect( x, y, x2, y2 ); > > /////////////////////////////// > > I have tried the following methods to fade the textures out with no luck: > SetAlpha( alpha ); > vgui::surface()->DrawSetAlphaMultiplier( alpha_multiplier ); > vgui::surface()->DrawSetColor( 255, 255, 255, alpha ); > > > > Does anyone here have a suggestion on how I can get the textures to > fade out properly? All that I've been able to do is get the text to > fade out with no effect on the textures > _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders