• A question regarding custom hud creation
    2 replies, posted
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 :) 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: [url]http://wiki.garrysmod.com/page/Global/Material[/url] Set draw color: [url]http://wiki.garrysmod.com/page/surface/SetDrawColor[/url] Set material: [url]http://wiki.garrysmod.com/page/surface/SetMaterial[/url] Draw the box: [url]http://wiki.garrysmod.com/page/surface/DrawTexturedRect[/url] You put all of this into a HUDPaint hook: [code] hook.Add("HUDPaint", "myuniqueHUD", function() -- functions here end)[/code] And you put all this code into a file in lua/autorun/client
[QUOTE=Robotboy655;41478474]Create material from your .png: [url]http://wiki.garrysmod.com/page/Global/Material[/url] Set draw color: [url]http://wiki.garrysmod.com/page/surface/SetDrawColor[/url] Set material: [url]http://wiki.garrysmod.com/page/surface/SetMaterial[/url] Draw the box: [url]http://wiki.garrysmod.com/page/surface/DrawTexturedRect[/url] You put all of this into a HUDPaint hook: [code] hook.Add("HUDPaint", "myuniqueHUD", function() -- functions here end)[/code] And you put all this code into a file in lua/autorun/client[/QUOTE] Thank you so much for the help. Looks like I have a bit of reading :) [editline]16th July 2013[/editline] So when I draw the png to screen, it flickers constantly. Anyway to fix that?
Sorry, you need to Log In to post a reply to this thread.