• DPanel Background
    10 replies, posted
I want have a background on my derma panel, how do i add one? I found DPanel.SetPaintBackground but idk if its what i want and theres no wiki page for it so idk.
[B][URL="http://wiki.garrysmod.com/?title=Panel.Paint"]Panel.Paint [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG][/URL][/B] ? But personally, I just drew a DImage straight after the DPanel, and then made it the size of the DPanel and set the material to the custom material I want.
ok, il use DImage Thanks for the help
[QUOTE=yuriman;22319009]ok, il use DImage Thanks for the help[/QUOTE] No problem yuri :3:
You should use [B][URL="http://wiki.garrysmod.com/?title=Panel.Paint"]Panel.Paint [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG][/URL][/B] and draw it manually, I'm not sure how much more efficient it will be, but it will be more efficient.
I find it easier to use DImage instead
[QUOTE=HeavyMtl123;22319198]I find it easier to use DImage instead[/QUOTE] Easyer is hardly ever better
I wouldn't say it's better, it's just easier to mess about with.
So how do i use Panel.Paint to pain a background? can anyone give em a example
[lua]local panel = vgui.Create("DFrame") panel:SetPos(10, 10) panel:SetSize(100, 100) function panel:Paint() local x, y, w, h = self:GetBounds() surface.SetDrawColor(255, 125, 0, 255) surface.DrawRect(0, 0, w, h) end panel:SetVisible(true) panel:MakePopup()[/lua]
thanks
Sorry, you need to Log In to post a reply to this thread.