Ok, I got that figured out, now how would I paint it? I think it was something like,
view plaincopy to clipboardprint?
[lua]
local Rules.Paint = function()[/lua]
or something.
Edited:
Also the background of the Rules tab is grey, can I change it to black?
I'm going to be very vague here, as it's pretty simple to do.
Use the [b][url=http://wiki.garrysmod.com/?title=Panel.Paint]Panel.Paint[/url][/b] (like in the examples) to over ride the default paint.
Then use [b][url=http://wiki.garrysmod.com/?title=Draw.RoundedBox]draw.RoundedBox()[/url][/b] with your own arguments, and set the position of it at (0,0) and size of the panel you are painting. I'd recommend using [b][url=http://wiki.garrysmod.com/?title=Panel.GetWide]Panel:GetWide()[/url][/b]/[b][url=http://wiki.garrysmod.com/?title=Panel.GetTall]Panel:GetTall()[/url][/b] for this.
I said Tab, as in Property Sheet.
[QUOTE=Justin37111;17836339]I said Tab, as in Property Sheet.[/QUOTE]
All you asked was how to make the background black instead of gray.
[quote]Also the background of the Rules tab is grey, can I change it to black?[/quote]
It says the background the little background of that tab in that little space, I want the tab color changed basically.
[lua]
for k,v in pairs(DPropertySheetName.Items) do
function v.Tab:Paint()
--do crap heah
end
end
[/lua]
I worked to figure that out myself, so be thankful :D
I got my Derma Panel background created but I need the Tabs panel baclgrounds also painted, there grey. But trying yakas now maybe it does that to
[editline]08:42PM[/editline]
Didn't work. This is it.
[lua]local Rules = vgui.Create("DListView")
Rules:SetParent(DermaSheet)
for k,v in pairs(Rules.Items) do
function v.Tab:Paint()
surface.SetDrawColor( 50, 50, 100, 175 )
surface.DrawRect( 0, 0, DermaPanel:GetWide(), DermaPanel:GetTall() )
end
end
function Rules:Paint()
local lolcounter = 1
draw.SimpleText("1)Don't spam props, it will result in a ban.", "ScoreboardText", 5, 5 * lolcounter)
lolcounter = lolcounter + 2
draw.SimpleText("2)Respect all players and administrators.", "ScoreboardText", 5, 10 * lolcounter)
lolcounter = lolcounter + 2
draw.SimpleText("3)Abuse of the NPC tool will result in a permanent ban!", "ScoreboardText", 5, 11 * lolcounter)
lolcounter = lolcounter + 2
draw.SimpleText("4)You may only fight if your opponent accepts.", "ScoreboardText", 5, 12 * lolcounter)
lolcounter = lolcounter + 2
draw.SimpleText("5)If you are caught AFK-ing to achieve 50 hours of play", "ScoreboardText", 5, 13 * lolcounter)
lolcounter = lolcounter + 1
draw.SimpleText("time your time will be reset and you will be punished.", "ScoreboardText", 5, 13 * lolcounter)
lolcounter = lolcounter + 1
draw.SimpleText("6)Do not minge unless an admin has designated a minge", "ScoreboardText", 5, 14 * lolcounter)
lolcounter = lolcounter + 1
draw.SimpleText("day, there is still no spamming of any kind during this period.", "ScoreboardText", 5, 14 * lolcounter)
lolcounter = lolcounter + 1
end[/lua]
I get this error
autorun/Derma.lua:54: bad argument #1 to 'pairs' (table expected, got nil)
You have to add the tabs first.
I got tons of tabs, and I've figured it out. Thanks.
Sorry, you need to Log In to post a reply to this thread.