Need help with cam3d2d and entities



local pos = self:GetPos()

cam.Start3D2D(pos, Angle(0, -20, 90), .1)
     draw.SimpleText('Health Progress','Font91',-180,-700,Color(255, 0, 0))
cam.End3D2D()


I’m trying to adjust the text on the prop but I am stuck on moving it outward so the text wont be in the prop. Using the Angle() and properties in draw.SimpleText I got it to go up a little and flip up but that’s all. I don’t know what numbers to change to make it go towards me or out of the prop. please help.

This is really hard to explain so here is a screen shot.

As you can see the text is in the prop.


local pos = self:GetPos() + Vector( x , y, z)

I dont even know if thats what you are looking for

Thx that’s exactly what I was looking for!

Well now I have another problem, when I rotate the object the textscreen doesn’t move with it it just says there. When I move the object the text goes with it but not when I rotate it. How do I lock it to stay on a certain place on the ent even when rotated.

Well I guess I just fixed it by adding


local ang = self:GetAngles()

but how to I change one of those angles. I want to change the z angle to 90 so it would be face upright

[editline]11th February 2017[/editline]

… And I fixed that by trying ang.z = 90… But it still doesn’t stay


self:GetUp()


self:GetRight()


self:GetForward()

are the things you need I think, always multiply those, putting + or - will make it all messed up

or maybe you need this:


ang:RotateAroundAxis()

This is really hard to explain so bare with me xD. You know how on methrp the text on the pot saying that it is a pot stays still so if you turn the pot around you wouldn’t see the text cause its on the other side. That’s what I am trying to do. Here is my code


function ENT:Draw()
	self:DrawModel()

	local pos = self:GetPos() + Vector( 1, -25, 6)
	local ang = self:GetAngles()
	ang.z = 90
	ang.x = 0
	ang.y = 0



	cam.Start3D2D(pos, ang, .1)
        draw.SimpleText('Health Progress','Font91',-300,-700,Color(255, 0, 0)) -- Font91 is declared above.
        draw.RoundedBox(20,-280,-720,400,300,Color(40, 40, 40, 255))
    cam.End3D2D()

end

Where do I put those? like self:GetRight()?


function ENT:Draw()
 
    self:DrawModel()
   
        local ang = self:GetAngles() 
        local pos = self:GetPos() + self:GetUp() * 25 + self:GetRight() * 10
 
            ang:RotateAroundAxis(self:GetAngles():Forward(), 90)
              cam.Start3D2D(pos, ang, 0.1)

             cam.End3D2D()
end


This is what I use right now for an addon,