• Drawing Text Above NPC Name
    5 replies, posted
[lua]function zmDrawNames() for k, v in pairs(ents.GetAll()) do if (v:GetClass() == "zm_vendors") then if !LocalPlayer():Alive() or !v:IsNPC() then return end local pos = v:GetPos() + Vector(0,0,15) local ang = LocalPlayer():EyeAngles() ang:RotateAroundAxis( ang:Forward(), 90 ) ang:RotateAroundAxis( ang:Right(), 90 ) cam.Start3D2D( pos, Angle( 0, ang.y, ang.r ), 0.25 ) draw.DrawText( "Text" , "ChatFont", 1, 1, Color( 0, 255, 255, 255 ), TEXT_ALIGN_CENTER ) cam.End3D2D() end end end hook.Add("HUDPaint", "zm_drawname", zmDrawNames) [/lua] Everything correctly gets called however no text is displayed... can't figure out whats wrong here
debug it, do "print("hi")" somewhere around the cam.Start3D2D, and see if it actually reaches there.
It does, I checked both pos and ang and they are the correct values, the problem seems to lie in the actual rendering portion...
Anyone else know anything about this problem?
[b][url=http://wiki.garrysmod.com/?title=Cam.Start3D2D]Cam.Start3D2D [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] doesn't work properly in HUDPaint, you need to use RenderScreenSpaceEffects.
The wiki lies =/
Sorry, you need to Log In to post a reply to this thread.