• Adding images to a HUD?
    3 replies, posted
How would you add an image to a hud? For example lets say we want to create a rounded box with some text and an image inside it supposedly a logo or whatever ? Do i need to add the vtf file to materials then use resource.addfile("picturename.vtf") but how do I add it in (code)
Send the file to the client, then use the surface library to draw the texture
Some client side file: [code] --the materials folder is the root directory local hpcross = surface.GetTextureID ("halflife/hp_cross") --this is a .vtf file --in a paint hook surface.SetTexture( hpcross ) surface.SetDrawColor( HUD_Color ) surface.DrawTexturedRect (hudPosX,hudPosY,iconSize,iconSize) [/code]
You can also use Materials: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/vgui/display_something_on_initial_spawn.lua.html[/url] Ignore net, etc; imagine HUDPaint is just created by itself...
Sorry, you need to Log In to post a reply to this thread.