Hello,
i'm trying to paint the buttons in a dcolumnsheet. If i paint in the dcolumnsheet it makes the entire panel a color which i don't want. I just want the buttons in the sheet painted.
I tried all threads on facepunch i could find, however all that code returned errors.`
The code i tried [CODE]
for k, v in pairs(DColumnSheet.Items) do
if (!v.Tab) then continue end
v.Tab.Paint = function(self,w,h)
draw.RoundedBox(0, 0, 0, w, h, Color(math.random(0,255),0,0))
end
end
[/CODE]
returned [CODE]
http://i.imgur.com/fsilPtO.png
[/CODE]
Unless you re-used the variable name, which you shouldn't've, 'DColumnSheet' is the class table used for all DColumnSheet panels. You need to use an actual panel object you created with vgui.Create().
[lua]
-- this works
local pnl = vgui.Create("DColumnSheet")
for k, v in pairs(pnl.Items) do
function v.Button:Paint(w, h)
-- ...
end
end
-- this doesn't
local pnl = DColumnSheet
for k, v in pairs(pnl.Items) do
function v.Button:Paint(w, h)
-- ...
end
end
[/lua]
Sorry, you need to Log In to post a reply to this thread.