Garry's Mod Wiki

DPanel:SetBackgroundColor

DPanel:SetBackgroundColor( table color )

Description

Sets the background color of the panel.

Arguments

1 table color
The background color.

Example

Creates two empty panels with their background colors set to red and blue team colors.

COLOR_TEAM_RED = Color(255, 64, 64, 255) COLOR_TEAM_BLUE = Color(153, 204, 255, 255) BGPanel1 = vgui.Create("DPanel") BGPanel1:SetPos(20, 20) BGPanel1:SetSize(200, 200) BGPanel1:SetBackgroundColor(COLOR_TEAM_RED) BGPanel2 = vgui.Create("DPanel") BGPanel2:SetPos(220, 20) BGPanel2:SetSize(200, 200) BGPanel2:SetBackgroundColor(COLOR_TEAM_BLUE)
Output:

Page Links


Special Pages


Wikis

?

Render Time: 58ms

DB GetPage 32
Generate Html 2
SaveChanges (1) 9
Render Body 0
Render Sidebar 12