How to create Avatar Image Over the head?
Is displayed simply as HUD
Code
cam.Start3D2D( ply:GetPos() + Vector( 0, 0, 85 ), Angle( 0, RenderAngles().y - 90, 90 ), 0.04 )
draw.SimpleTextOutlined(ply:GetName() or "", "RelaxHud_NickFont_Big", 0, x + 85, Color(255,255,255), TEXT_ALIGN_CENTER, 0, 3, Color(0,0,0,255))
DRAvatar = DRAvatar or vgui.Create("AvatarImage")
DRAvatar:SetSize( 54, 54 )
DRAvatar:SetPos( 0, x + 85 )
DRAvatar:SetVisible(true)
DRAvatar:SetPlayer(ply)
DRAvatar.PaintOver = function(self, w, h)
local ply = LocalPlayer()
local ob = ply:GetObserverTarget()
if ob && IsValid(ob) && ob:Alive() then
ply = ob
end
surface.SetDrawColor(Color(0,0,0))
surface.DrawOutlinedRect(0,0,w,h)
end
cam.End3D2D()
https://files.facepunch.com/forum/upload/273339/cc14f92b-d6ef-4b02-b9c3-bb7f237deb16/Screenshot_3.png
Avatar's x position is 0
This will not help because AvatarImage Create in the HUD but not Cam3D2D
Vector/ToScreen
Sorry, you need to Log In to post a reply to this thread.