DModelPanel/GetEntity

From Garry's Mod
Jump to: navigation, search
 DModelPanel:GetEntity( )

Contents

DescriptionPanelFunc

Returns the entity being rendered by the model panel.

Returns

CSEnt

The rendered entity (client-side)

Examples

Example

Creates an antlion model panel and sets the antlion's skin to 1.

BGPanel = vgui.Create("DPanel")
BGPanel:SetPos(20, 20)
BGPanel:SetSize(200, 200)
	
local mdl = vgui.Create("DModelPanel", BGPanel)
mdl:SetSize(200, 200)
mdl:SetModel("models/antlion.mdl")
mdl:SetLookAt(Vector(0, 0, 20))

mdl:GetEntity():SetSkin(1)

Output:



DModelPanel GetEntity example1.jpg
Personal tools
Navigation