<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[SweptForums - Support]]></title>
		<link>https://forums.sweptthr.one/</link>
		<description><![CDATA[SweptForums - https://forums.sweptthr.one]]></description>
		<pubDate>Thu, 23 Jul 2026 21:08:33 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[How To Fix Stuff Drawing In Front of Your 3D2D]]></title>
			<link>https://forums.sweptthr.one/thread-102.html</link>
			<pubDate>Sat, 22 Jun 2024 01:38:32 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forums.sweptthr.one/member.php?action=profile&uid=1">SweptThrone</a>]]></dc:creator>
			<guid isPermaLink="false">https://forums.sweptthr.one/thread-102.html</guid>
			<description><![CDATA[<span style="font-weight: bold;" class="mycode_b">Set <code>ENT.RenderGroup = RENDERGROUP_BOTH</code> in your entity's shared file.</span><br />
<span style="font-weight: bold;" class="mycode_b">Create a new <code>ENT:DrawTranslucent()</code> hook and move all of your 3D2D code to it.  Keep <code>self:DrawModel()</code> in <code>ENT:Draw()</code>.  These should both be clientside only.</span><br />
<br />
Pretty simple fix for a common problem.  It makes sense when you think about it, but if you're like me, you never even knew there was a "DrawTranslucent" hook for entities.  This is the case even if your 3D2D isn't translucent, as you can see below.  Both the opaque text and the translucent background are drawn behind the door before the fix, and in front of it after.<br />
<br />
<img src="https://sweptthr.one/img/fixdumb.png" loading="lazy"  width="640" height="360" alt="[Image: fixdumb.png]" class="mycode_img" /><br />
<br />
Shoutout to Fesiug for helping me fix this on STRP.<br />
<br />
Here's an example from STFood Neu STRP Edition's stove:<br />
<br />
<div class="codeblock">
<div class="title">Bad Example</div>
<div class="body" dir="ltr"><code>-- BAD, DO NOT USE THIS
-- st_food_neu_stove.lua (shared)

AddCSLuaFile()

ENT.Type = "anim"
ENT.Base = "base_anim"
 
ENT.PrintName = "Stove"
ENT.Author = "SweptThrone"
ENT.Contact = "sweptthr.one/contact"
ENT.Spawnable = true
ENT.AdminSpawnable = false
ENT.Category = "STFood Neu"

if CLIENT then
    function ENT:Draw()
        self:DrawModel()

        local Pos = self:GetPos()
        local Ang = self:GetAngles()
        
        Ang:RotateAroundAxis(Ang:Forward(), 90)
        Ang:RotateAroundAxis(Ang:Right(), 270)
        
        local txt = "Serve Food!"
        
        surface.SetFont( "DermaLarge" )
        local TextWidth = surface.GetTextSize( txt )
        cam.Start3D2D( Pos + Ang:Up() * -15 + Ang:Right() * ( 5 + TimedSin( 0.25, 0, 2, 0 ) ) - Ang:Forward() * 1.5, Ang, 0.16 )
            draw.WordBox( 4, -TextWidth*0.5, -260, txt, "DermaLarge", Color( 0, 0, 0, 200 ), Color( 255, 255, 255, 255 ) )
        cam.End3D2D()
        
    end
end</code></div>
</div>
<br />
<div class="codeblock">
<div class="title">Good Example</div>
<div class="body" dir="ltr"><code>-- GOOD, USE THIS EXAMPLE
-- st_food_neu_stove.lua (shared)

AddCSLuaFile()

ENT.Type = "anim"
ENT.Base = "base_anim"

ENT.PrintName = "Stove"
ENT.Author = "SweptThrone"
ENT.Contact = "sweptthr.one/contact"
ENT.Purpose = ""
ENT.Instructions = ""
ENT.Spawnable = true
ENT.AdminSpawnable = false
ENT.Category = "STFood Neu"

ENT.RenderGroup = RENDERGROUP_BOTH

if CLIENT then
    function ENT:Draw()
        self:DrawModel()
    end

    function ENT:DrawTranslucent()
        local Pos = self:GetPos()
        local Ang = self:GetAngles()
       
        Ang:RotateAroundAxis(Ang:Forward(), 90)
        Ang:RotateAroundAxis(Ang:Right(), 270)
       
        local txt = "Serve Food!"
       
        surface.SetFont( "DermaLarge" )
        local TextWidth = surface.GetTextSize( txt )
        cam.Start3D2D( Pos + Ang:Up() * -15 + Ang:Right() * ( 5 + TimedSin( 0.25, 0, 2, 0 ) ) - Ang:Forward() * 1.5, Ang, 0.16 )
            draw.WordBox( 4, -TextWidth*0.5, -260, txt, "DermaLarge", Color( 0, 0, 0, 200 ), Color( 255, 255, 255, 255 ) )
        cam.End3D2D()
       
    end
end</code></div>
</div>]]></description>
			<content:encoded><![CDATA[<span style="font-weight: bold;" class="mycode_b">Set <code>ENT.RenderGroup = RENDERGROUP_BOTH</code> in your entity's shared file.</span><br />
<span style="font-weight: bold;" class="mycode_b">Create a new <code>ENT:DrawTranslucent()</code> hook and move all of your 3D2D code to it.  Keep <code>self:DrawModel()</code> in <code>ENT:Draw()</code>.  These should both be clientside only.</span><br />
<br />
Pretty simple fix for a common problem.  It makes sense when you think about it, but if you're like me, you never even knew there was a "DrawTranslucent" hook for entities.  This is the case even if your 3D2D isn't translucent, as you can see below.  Both the opaque text and the translucent background are drawn behind the door before the fix, and in front of it after.<br />
<br />
<img src="https://sweptthr.one/img/fixdumb.png" loading="lazy"  width="640" height="360" alt="[Image: fixdumb.png]" class="mycode_img" /><br />
<br />
Shoutout to Fesiug for helping me fix this on STRP.<br />
<br />
Here's an example from STFood Neu STRP Edition's stove:<br />
<br />
<div class="codeblock">
<div class="title">Bad Example</div>
<div class="body" dir="ltr"><code>-- BAD, DO NOT USE THIS
-- st_food_neu_stove.lua (shared)

AddCSLuaFile()

ENT.Type = "anim"
ENT.Base = "base_anim"
 
ENT.PrintName = "Stove"
ENT.Author = "SweptThrone"
ENT.Contact = "sweptthr.one/contact"
ENT.Spawnable = true
ENT.AdminSpawnable = false
ENT.Category = "STFood Neu"

if CLIENT then
    function ENT:Draw()
        self:DrawModel()

        local Pos = self:GetPos()
        local Ang = self:GetAngles()
        
        Ang:RotateAroundAxis(Ang:Forward(), 90)
        Ang:RotateAroundAxis(Ang:Right(), 270)
        
        local txt = "Serve Food!"
        
        surface.SetFont( "DermaLarge" )
        local TextWidth = surface.GetTextSize( txt )
        cam.Start3D2D( Pos + Ang:Up() * -15 + Ang:Right() * ( 5 + TimedSin( 0.25, 0, 2, 0 ) ) - Ang:Forward() * 1.5, Ang, 0.16 )
            draw.WordBox( 4, -TextWidth*0.5, -260, txt, "DermaLarge", Color( 0, 0, 0, 200 ), Color( 255, 255, 255, 255 ) )
        cam.End3D2D()
        
    end
end</code></div>
</div>
<br />
<div class="codeblock">
<div class="title">Good Example</div>
<div class="body" dir="ltr"><code>-- GOOD, USE THIS EXAMPLE
-- st_food_neu_stove.lua (shared)

AddCSLuaFile()

ENT.Type = "anim"
ENT.Base = "base_anim"

ENT.PrintName = "Stove"
ENT.Author = "SweptThrone"
ENT.Contact = "sweptthr.one/contact"
ENT.Purpose = ""
ENT.Instructions = ""
ENT.Spawnable = true
ENT.AdminSpawnable = false
ENT.Category = "STFood Neu"

ENT.RenderGroup = RENDERGROUP_BOTH

if CLIENT then
    function ENT:Draw()
        self:DrawModel()
    end

    function ENT:DrawTranslucent()
        local Pos = self:GetPos()
        local Ang = self:GetAngles()
       
        Ang:RotateAroundAxis(Ang:Forward(), 90)
        Ang:RotateAroundAxis(Ang:Right(), 270)
       
        local txt = "Serve Food!"
       
        surface.SetFont( "DermaLarge" )
        local TextWidth = surface.GetTextSize( txt )
        cam.Start3D2D( Pos + Ang:Up() * -15 + Ang:Right() * ( 5 + TimedSin( 0.25, 0, 2, 0 ) ) - Ang:Forward() * 1.5, Ang, 0.16 )
            draw.WordBox( 4, -TextWidth*0.5, -260, txt, "DermaLarge", Color( 0, 0, 0, 200 ), Color( 255, 255, 255, 255 ) )
        cam.End3D2D()
       
    end
end</code></div>
</div>]]></content:encoded>
		</item>
	</channel>
</rss>