• 3D2D HUD Draw Coordinates
    0 replies, posted
Need a little help with figuring out how to position 3D2D elements in front of the player as a HUD, below is what I've tried but I need to somehow be able to draw using the full resolution space and this current method feels wrong. The elements also don't face the player on the Z axis this way. [CODE]hook.Add( "PostDrawOpaqueRenderables", "example", function() --[[cam.Start3D2D( LocalPlayer():GetEyeTrace().HitPos + Vector(0,0,40), Angle( 0,0,0 ), 1) surface.SetDrawColor(255,255,255) surface.DrawRect(0,0,50,50) cam.End3D2D()]] local eyePos = LocalPlayer():EyePos() local forward = LocalPlayer():GetForward() local forwardAngle = forward:Angle() cam.Start3D2D( eyePos + (forward * 20), Angle(0, forwardAngle.y-90, forwardAngle.r + 90), 0.2) surface.SetDrawColor(255,255,255) surface.DrawRect(0,0,50,50) draw.SimpleText( "Testing", "TargetID", 0, 0, Color(255,0,0))--, number xAlign, number yAlign ) cam.End3D2D() end )[/CODE]
Sorry, you need to Log In to post a reply to this thread.