Garry's Mod Wiki

DModelPanel:SetAmbientLight

DModelPanel:SetAmbientLight( table color )

Description

Sets the ambient lighting used on the rendered entity.

Arguments

1 table color
The color of the ambient lighting.

Example

Displays a model panel with a watermelon that has red ambient lighting.

BGPanel = vgui.Create("DPanel") BGPanel:SetPos(20, 20) BGPanel:SetSize(200, 200) local mdl = vgui.Create("DModelPanel", BGPanel) mdl:SetSize(BGPanel:GetSize()) mdl:SetModel("models/props_junk/watermelon01.mdl") mdl:SetCamPos(Vector(15, 15, 0)) mdl:SetLookAt(Vector(0, 0, 0)) mdl:SetAmbientLight(Color(255, 0, 0, 255))
Output:

Page Links


Special Pages


Wikis

?

Render Time: 30ms

DB GetPage 4
Generate Html 3
SaveChanges (1) 9
Render Body 0
Render Sidebar 12