function DrawName( ply )
local pos = ply:EyePos(); pos.z = pos.z + 15 local ang = ply:EyeAngles(); local dist = LocalPlayer():GetPos():Distance( ply:GetPos() ); cam.Start3D2D( pos, EyeAngles():Right():Angle() + Angle(0,0,90), 0.25 ); draw.DrawText( "Some Text", "Font_HUDFont", 2, 2, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER ) cam.End3D2D();
hook.Add( “PostPlayerDraw”, “DrawName”, DrawName )
This performs as expected, but I’m trying to position the 3d/2d camera closer based on the distance.
So the text is larger when the distance is far, and smaller when it’s near.
I’m terrible at math, can anybody provide any insight?