Hello i just need to add a name hovering above a npc i created that opens a menu. thats it.
There are many options....
In a draw hook you could:
[code]local _x, _y = ( self:GetPos( ) + Vector( 0, 0, 90 ) ):ToScreen( );[/code]
And draw the text using surface commands...
Alternatively, you could use Cam 2d3d and render text above the head, but you'd need to do it in a render hook ( ENT:Draw may work )...
hmm can you elaborate :) thnx anyways im good so far
[URL=http://wiki.garrysmod.com/page/cam/Start3D2D]cam.Start3D2D[/URL]
Just look at the example there and see if you can modify it to how you want.
thnx. :) i will try to get it working
i'm still having trouble ... trying to get a name above the npc :) any help would be great
[QUOTE=CertifiedCode;46087612]i'm still having trouble ... trying to get a name above the npc :) any help would be great[/QUOTE]
Give us what you have and somebody will get around to fixing it for you
i don't got much resources tats why i came here.
[editline]27th September 2014[/editline]
[lua]
surface.CreateFont( "coolvetica", 64, 500, true, false, "Text64" )
function GM:PostDrawOpaqueRenderables()
for _, ent in pairs(ents.FindByClass("npcclass")) do
cam.Start3D2D(ent:GetPos()+Vector(0,0,90), ent:GetAngles() + Angle(0,90,90), 0.1)
draw.SimpleText("Hello World!", "Text64", 0, -90, Color(255,0,0,255), TEXT_ALIGN_CENTER, 1)
cam.End3D2D()
end
end
[/lua]
i got that from here [url]http://facepunch.com/showthread.php?t=1061784[/url] i put it in my cl_init dosnt seem to work. no errors.
[noparse][lua][/lua][/noparse] tags ...
sorry
[editline]27th September 2014[/editline]
Bump still need help my bros
BROOS
Sorry, you need to Log In to post a reply to this thread.