DModelPanel/SetAmbientLight

From Garry's Mod
Revision as of 21:17, 18 September 2014 by Microflash (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 DModelPanel:SetAmbientLight( )

Contents

DescriptionPanelFunc

Sets the ambient lighting used on the rendered entity.

Arguments

table color

The color of the ambient lighting.

Examples

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:



DModelPanel SetAmbientLight example1.jpg
Personal tools
Navigation