[LUA]function DoorInfoTab()
local tr = LocalPlayer():GetEyeTraceNoCursor()
if tr.Entity:IsOwnable() and tr.Entity:GetPos():Distance(LocalPlayer():GetPos()) < 300 then
local ang = LocalPlayer():EyeAngles()
local pos = tr.HitPos
ang:RotateAroundAxis( ang:Forward(), 180 )
cam.Start3D2D( pos ,ang,4 )
draw.RoundedBoxEx(6, 2, 2, 122,120, Color(255,0,0,50),true, true, true, true)
tr.Entity:DrawOwnableInfo()
cam.End3D2D()
end
end
hook.Add("HUDPaint", "DoorInfo", DoorInfoTab)
[/LUA]
When i see on a door, I do not see what I wanted to paint. I have tried many options but none of them brought the desired result. My brain exploded. Please help me.
I don't think that 3D2D cams work in HUDPaint hook, correct me if i'm wrong.
They don't, use a PreDrawOpaqueRenderables or a RenderScreenspaceEffects.
If you use RenderScreenspaceEffects make sure you wrap the 3d2d in a 3d cam.
Thanks, ill try to use it
[editline]10th March 2013[/editline]
PostDrawTranslucentRenderables helped me :dance:
but thanks for info about hook)
But i have new problem. If i use PostDrawOpaqueRenderables hook, when tab collides with door, half part of tab disappears. And if i use PreDrawOpaqueRenderables hook, tab draws behind of door. Any ideas how to fix it?
Or can you describe in details how to draw it with RenderScreenspaceEffects hook?
[FIXED] by adding cam.IgnorZ() function after cam.start3d2d()
Sorry, you need to Log In to post a reply to this thread.