Panel:SetPlayer
Example
Creates an AvatarImage with the LocalPlayer's avatar inside.
concommand.Add( "testavatar", function()
local Panel = vgui.Create( "DFrame" )
Panel:SetPos( 200, 200 )
Panel:SetSize( 500, 500 )
Panel:SetTitle( "Avatar Test" )
Panel:MakePopup()
local Avatar = vgui.Create( "AvatarImage", Panel )
Avatar:SetSize( 64, 64 )
Avatar:SetPos( 4, 30 )
Avatar:SetPlayer( LocalPlayer(), 64 )
-- After a second reset the avatar to no player
timer.Simple( 1, function() Avatar:SetPlayer( NULL, 64 ) end )
end )