Code is glitching. Works only for one side of doors with a yaw angle of 90 and -90. The rest of doors just don't work. Any ideas?
local door = FindMetaTable("Entity")
function door:DrawDoorInfo()
if !self:IsDoor() then print("not door") return end
if self:GetNetVar("title") == "" or self:GetNetVar("title") == nil then return end
local ang = self:GetAngles()
cam.Start3D()
ang:RotateAroundAxis(self:GetAngles():Forward(), 90)
ang:RotateAroundAxis(self:GetAngles():Up(), 90)
cam.Start3D2D(self:GetPos() + Vector(0, 0, 75), ang, 0.12)
surface.SetFont("TargetID")
local tsX, tsY = surface.GetTextSize("The test")
draw.DrawNonParsedText(self:GetNetVar("title") .. " 123123", "TargetID", 200, 450, black, 1)
cam.End3D2D()
ang:RotateAroundAxis(ang:Right(), 180)
cam.Start3D2D(self:GetPos() + Vector(-47, 0, 75), ang, 0.12)
draw.DrawNonParsedText(self:GetNetVar("title"), "TargetID", 200, 450, black, 1)
cam.End3D2D()
cam.End3D()
return true
end
Sorry, you need to Log In to post a reply to this thread.