Draw Text at a point in space.

Pretty much the title. I want to be able to draw (Clientside) Text at a point on the map.

Read the sticky first, use the search function. This question has been answered many times.

**

Cam.Start3D2D**

3 arguments. Position, Angle and Scale. All self explainable.

Example of use:

[lua]
cam.Start3D2D( Vector(0, 0, 0), Angle(0, 0, 0), 1 )
draw.DrawText(“Your Mother”, “ScoreboardText”, 0, 0, Color(255, 255, 255, 255), TEXT_ALIGN_CENTER )
cam.End3D2D()
[/lua]

Another way to do it is through a HUDPaint hook, which works very much the same as what iRzilla posted.

[lua]
function GM:HUDPaint( )

-- Get the position of the player's eyes
local pos = LocalPlayer( ):EyePos( )

-- Turn the (3-point) vector into a (2-point) coordinate on the screen
pos = pos:ToScreen( )

-- Draw it
draw.DrawText( "Text on mah face", "Default", pos.x, pos.y, color_white, 1 )

end
[/lua]

I’m not trying to be redundant but I know that for some, using the render and Cam library functions is kind of confusing.

It works nothing like what iRzilla posted, the cam library positions the 3D rendering camera in 3D space, therefore the text will rotate and scale depending on your relative position to it, what you posted will only draw on the screen and therefore will not rotate and scale at all, it just produces a crappy illusion that the text is drawn in 3D space.

Yes but he’s asking how to draw text at a certain point in 3D space. Crappy or not my method does just that, and its probably much less expensive than using Cam functions.

Drawing on the screen is not the same as drawing in 3D space, It may be a little bit more expensive to draw it properly, but it sure does look a hell of a lot better.

Yeah, you’ve got a point there.