Can I draw a Cam3D2D on only one instance of an entity instead of all of them?
0 replies, posted
Lets say I wanted to have a button of sorts in cam3d2d on my entity that would open another box using cam3d2d when clicked. How do I make it so that the box will only appear on the instance of the entity where that button is clicked?
Here is the code that I am using for my cam3d2d, imagine CreateMenu() is draw.RoundedBox() or something similar, how would I do the above question:
cam.Start3D2D(position, angle, 0.1)
local TraceLine = util.TraceLine({start = ply:GetShootPos(), endpos = ply:GetShootPos() + (ply:GetAimVector() * 200), filter = ply})
local HitPos = self:WorldToLocal(TraceLine.HitPos)
if TraceLine.Entity == self and HitPos.x <= 8.86 and HitPos.x >= -9.44 and HitPos.z <= -5 and HitPos.z >= -13.61 then
c = Color(255, 165, 0)
if ply:KeyDown(IN_USE) and FramesOpened < 1 then
CreateMenu()
FramesOpened = FramesOpened + 1
end
else
c = Color(60,60,60, 200)
end
draw.RoundedBox(10, -100, -200, 200, 350, Color(120, 120, 120, 200))
draw.RoundedBox(10, -90, 60, 180, 80, c)
draw.SimpleText("Installed Printers", "Derma", 0, -200, Color(255,255,255,255), TEXT_ALIGN_CENTER)
--Installed Printers
for v = 1,6 do
draw.SimpleText(installed_printers[v], "Derma", 0, -200 - (-35 * v), printer_colors[v], TEXT_ALIGN_CENTER)
end
draw.SimpleText("MENU", "MENU", 0, 70, Color(255,255,255,255), TEXT_ALIGN_CENTER)
cam.End3D2D()
Sorry, you need to Log In to post a reply to this thread.