From GMod Wiki
Usage
A Steam avatar image, can be used on anything
Description | Creates an avatar image of the local player parented to a simple frame. |
Used on | |
Code |
local frame = vgui.Create("DFrame")
local av = vgui.Create("AvatarImage", frame)
av:SetPos(50,50)
av:SetSize(32, 32)
av:SetPlayer( LocalPlayer(), 32 )
frame:SetSize( ScrW()*0.25, ScrH()*0.25 )
frame:Center()
frame:SetVisible( true )
frame:MakePopup()
|
Output | Derma frame with the avatar image in it. |
Methods
Panel.SetPlayer
Panel.GetPlayer
Additional Notes
- Avoid setting the player too often, doing so will leak memory.
- For best appearance, set the size to no larger than 184x184, recommended resolutions are 32x32, 64x64 and 184x184.