Thank you :) I will give it a shot. I was just curious how to get a texture
on a panel, but I think I may have got it.

-Gabe

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Alfred Reynolds
Sent: Thursday, March 10, 2005 6:17 PM
To: [email protected]
Subject: RE: [hlcoders] Texturing a HuD Element -- need help

m_nBgTextureId1 is a panel animation var, in its defintion you can see
the texture file it loads. You should use an ImagePanel to draw an
image. If you must do all the work by hand then try something like this:
        vgui::surface()->DrawSetTextureFile(m_nTextureID, "vgui/ammobg",
true, false);
        vgui::surface()->DrawSetColor(_color[0], _color[1], _color[2],
_color[3]);
        vgui::surface()->DrawTexturedRect( 0, 0, 100, 100 );

Note that _color[3] needs to be greater than zero otherwise the texture
isn't rendered (since it has no alpha value :). Also note that you call
DrawSetTextureFile() each time you paint (in case the texture was
flushed from the texture cache during the last frame, the underlying
code only reloads the file if required).

- Alfred



_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to