-- EntityInfo

surface.CreateFont("mg_instructions", {font = "Roboto", size = 22, weight = 1000, blursize = 0, scanlines = 0, antialias = true})
surface.CreateFont("mg_instructions2", {font = "Roboto", size = 16, weight = 1000, blursize = 0, scanlines = 0, antialias = true})

surface.CreateFont("mg_ent_font", {font = "Roboto", size = 50, weight = 600, blursize = 0, scanlines = 0, antialias = true})
surface.CreateFont("mg_ent_font2", {font = "Roboto", size = 30, weight = 500, blursize = 0, scanlines = 0, antialias = true})

local vector_1 = Vector(0, 0, 1)
local local_ply
function MG_DrawEntity3D2D(ent, tab)
	local_ply = local_ply or LocalPlayer()
	local pos = ent:GetPos()
	local dist = local_ply:EyePos():DistToSqr(pos)
	if dist > (tab.distance or 40000) then return end
	local newpos = pos + (vector_1 * ((tab.offsetoverride or ent:OBBMaxs().z) + (tab.offset or 0) + (tab.hoveroverride or math.sin(SysTime() * 2)) * (tab.hovermult or 2)))
	if tab.pos_add then
		newpos = newpos + tab.pos_add
	end
	cam.Start3D2D(tab.pos or newpos, tab.ang or Angle(0, EyeAngles().y - 90, 90), tab.size or 0.05)
		for _, v in ipairs(tab.lines) do
			if !v.line or v.line == "" then continue end
			draw.SimpleTextOutlined(v.line or ent.PrintName, v.font or "mg_ent_font2", 0, v.offset or 0, v.color or color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, v.width or 1, v.bgcolor or color_black)
		end
	cam.End3D2D()
end

-- Hülle von Spielern modifizieren

local function HullScale(um)
	local ply = net.ReadEntity()
	if !IsValid(ply) then return end
	local x1, x2, y1, y2 = net.ReadVector(), net.ReadVector(), net.ReadVector(), net.ReadVector()
	ply:SetHull(x1, x2)
	ply:SetHullDuck(y1, y2)
end
net.Receive("MG_Lib_Hull", HullScale)