Drawing text on my printers using angles

I’m trying to get text to keep a certain position on my printer when I rotate the entity.


include("shared.lua")

function ENT:Initialize()
end

function ENT:Draw()
	self:DrawModel()

	local Pos = self:GetPos() 
        local Offset = Vector( -3, 14 , 26 )
	local Ang = self:GetAngles()

	surface.SetFont("HUDNumber5")
	local text = ("Large printer")
	local TextWidth = surface.GetTextSize(text)
	local RandomColor = math.random(0,255)

        Ang:RotateAroundAxis(Ang:Forward(), 90)
        Ang:RotateAroundAxis(Ang:Right(), -90)
 
	cam.Start3D2D( Pos + Offset + Ang:Forward() + Ang:Right(), Ang, 0.135)
		draw.WordBox(2, -TextWidth*0.5, -10, text, "HUDNumber5", Color( 0, 0, 125, 100), Color(255,255,255,255))
	cam.End3D2D()
end

function ENT:Think()
end


If anybody could explain to me how to solve my problem i would appreciate it.

Straight

http://cloud-2.steampowered.com/ugc/594786228012410108/72C38705A70FB8FCECC6CB4C4579A72104FFFDF6/

Rotated

http://cloud-4.steampowered.com/ugc/594786228012411873/F9FA8A0F11D8544CFB545525957A93BB66890F43/

Your ‘Offset’ variable is a vector and it currently won’t change based on the angle of your entity. I recommend modifying that variable to something like below. You’ll have to mess around with the numbers a bit, but it seems to be what you’re looking for.



local ang = self:GetAngles()
local offset = ( ang:Forward()*5 ) + ( ang:Right()*10 ) + ( ang:Up()*10 )