What can i use to set the texture of a DButton to this material?
[CODE]gamemodes/terrortown/content/materials/vgui/ttt/icon_traitor[/CODE]
I've tried
[CODE]DButton:SetMaterial("vgui/ttt/icon_traitor")[/CODE]
and also
[CODE]DButton.Paint = function()
surface.SetMaterial( Material("vgui/ttt/icon_traitor"))
end[/CODE]
But none of them have worked
[lua]
local tIcon = Material("MatPath")
Button.Paint = function(self,w,h)
surface.SetDrawColor(255,255,255)
surface.SetMaterial(tIcon)
surface.DrawTexturedRect(0,0,w,h)
end
[/lua]
For a textured dbutton, use brandon's solution, but if you want an easier way to do it, use [url=http://wiki.garrysmod.com/page/VGUI/Elements/DImageButton]DImageButton[/url]
Sorry, you need to Log In to post a reply to this thread.