3D2D Simple Text

Hey guys,

I just wanted to test this function, but I can’t figure it out how that works…



cam.Start3D2D( Vector( 0, 0, 0 ), Angle( 0, 0, 0), 1 )
	print( "test" )
	draw.DrawText( "Test", "Default", 0, 0, Color( 255, 255, 255, 255), TEXT_ALIGN_CENTER )
cam.End3D2D()

I only want to get a 2D Message on the Position (0, 0, 0)… nothing special (just a test)

After many fails I thought, that I post a question here.
I hope that you can help me.

I am running this over a client lua file.

Thanks for help.

Btw. I found some other posts about this function, but that was too complex (with Meta Tables and so on…)

You’ll want to put it in a render hook, such as PostDrawOpaqueRenderables
[lua]hook.Add( “PostDrawOpaqueRenderables”, “3D2D Text Test”, function()
cam.Start3D2D( Vector( 0, 0, 0 ), Angle( 0, 0, 0), 1 )
print( “test” )
draw.DrawText( “Test”, “Default”, 0, 0, Color( 255, 255, 255, 255), TEXT_ALIGN_CENTER )
cam.End3D2D()
end)[/lua]

There it is!

Thank you very much