A question regarding custom hud creation

I am rather new-ish to the whole world of LUA and Gmod LUA. I had a question regarding the creation of a custom hud. So my question. . .

Is there anyway to draw images to screen (like a vmt, jpeg, png, etc) so that I may position text on it? If there is a way to draw an image to screen, can you please point me in the right direction :slight_smile: If it isn’t possible to do so, Can you give possibly some information on how a detailed custom hud is created or possibly direct me to some resources?

Thank you for any and all help.

Create material from your .png: http://wiki.garrysmod.com/page/Global/Material
Set draw color: http://wiki.garrysmod.com/page/surface/SetDrawColor
Set material: http://wiki.garrysmod.com/page/surface/SetMaterial
Draw the box: http://wiki.garrysmod.com/page/surface/DrawTexturedRect

You put all of this into a HUDPaint hook:



hook.Add("HUDPaint", "myuniqueHUD", function()
-- functions here
end)

And you put all this code into a file in lua/autorun/client

Thank you so much for the help. Looks like I have a bit of reading :slight_smile:

[editline]16th July 2013[/editline]

So when I draw the png to screen, it flickers constantly. Anyway to fix that?