• custom textured inventory menu
    4 replies, posted
Is there a way to put custom textures on any type of menu, ect. an inventory menu?
[url=http://wiki.garrysmod.com/page/surface/DrawTexturedRect]surface.DrawTexturedRect[/url], [url=http://wiki.garrysmod.com/page/surface/SetMaterial]surface.SetMaterial[/url], and the basics of Derma/VGUI and using paint hooks.
Can you give me an example?
[code] local mat = Material("icon16/box.png") --example image testframe = vgui.Create("DFrame") testframe:SetSize(200,100) testframe:Center() testframe:SetTitle("") testframe:MakePopup() local inv = vgui.Create("DGrid",testframe) inv:Dock(FILL) inv:SetCols(5) inv:SetColWide(32) for i = 1,10 do local invitem = vgui.Create("DPanel") invitem:SetSize(32,32) function invitem:Paint(w,h) if i = 1 then surface.SetDrawColor(color_white) surface.SetMaterial(mat) surface.DrawTexturedRect(0,0,w,h) end end end [/code]
thanks :)
Sorry, you need to Log In to post a reply to this thread.