<?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, 21 May 2026 18:26:08 +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<br />
-- st_food_neu_stove.lua (shared)<br />
<br />
AddCSLuaFile()<br />
<br />
ENT.Type = "anim"<br />
ENT.Base = "base_anim"<br />
 <br />
ENT.PrintName = "Stove"<br />
ENT.Author = "SweptThrone"<br />
ENT.Contact = "sweptthr.one/contact"<br />
ENT.Spawnable = true<br />
ENT.AdminSpawnable = false<br />
ENT.Category = "STFood Neu"<br />
<br />
if CLIENT then<br />
    function ENT:Draw()<br />
        self:DrawModel()<br />
<br />
        local Pos = self:GetPos()<br />
        local Ang = self:GetAngles()<br />
        <br />
        Ang:RotateAroundAxis(Ang:Forward(), 90)<br />
        Ang:RotateAroundAxis(Ang:Right(), 270)<br />
        <br />
        local txt = "Serve Food!"<br />
        <br />
        surface.SetFont( "DermaLarge" )<br />
        local TextWidth = surface.GetTextSize( txt )<br />
        cam.Start3D2D( Pos + Ang:Up() * -15 + Ang:Right() * ( 5 + TimedSin( 0.25, 0, 2, 0 ) ) - Ang:Forward() * 1.5, Ang, 0.16 )<br />
            draw.WordBox( 4, -TextWidth*0.5, -260, txt, "DermaLarge", Color( 0, 0, 0, 200 ), Color( 255, 255, 255, 255 ) )<br />
        cam.End3D2D()<br />
        <br />
    end<br />
end</code></div>
</div>
<br />
<div class="codeblock">
<div class="title">Good Example</div>
<div class="body" dir="ltr"><code>-- GOOD, USE THIS EXAMPLE<br />
-- st_food_neu_stove.lua (shared)<br />
<br />
AddCSLuaFile()<br />
<br />
ENT.Type = "anim"<br />
ENT.Base = "base_anim"<br />
<br />
ENT.PrintName = "Stove"<br />
ENT.Author = "SweptThrone"<br />
ENT.Contact = "sweptthr.one/contact"<br />
ENT.Purpose = ""<br />
ENT.Instructions = ""<br />
ENT.Spawnable = true<br />
ENT.AdminSpawnable = false<br />
ENT.Category = "STFood Neu"<br />
<br />
ENT.RenderGroup = RENDERGROUP_BOTH<br />
<br />
if CLIENT then<br />
    function ENT:Draw()<br />
        self:DrawModel()<br />
    end<br />
<br />
    function ENT:DrawTranslucent()<br />
        local Pos = self:GetPos()<br />
        local Ang = self:GetAngles()<br />
       <br />
        Ang:RotateAroundAxis(Ang:Forward(), 90)<br />
        Ang:RotateAroundAxis(Ang:Right(), 270)<br />
       <br />
        local txt = "Serve Food!"<br />
       <br />
        surface.SetFont( "DermaLarge" )<br />
        local TextWidth = surface.GetTextSize( txt )<br />
        cam.Start3D2D( Pos + Ang:Up() * -15 + Ang:Right() * ( 5 + TimedSin( 0.25, 0, 2, 0 ) ) - Ang:Forward() * 1.5, Ang, 0.16 )<br />
            draw.WordBox( 4, -TextWidth*0.5, -260, txt, "DermaLarge", Color( 0, 0, 0, 200 ), Color( 255, 255, 255, 255 ) )<br />
        cam.End3D2D()<br />
       <br />
    end<br />
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<br />
-- st_food_neu_stove.lua (shared)<br />
<br />
AddCSLuaFile()<br />
<br />
ENT.Type = "anim"<br />
ENT.Base = "base_anim"<br />
 <br />
ENT.PrintName = "Stove"<br />
ENT.Author = "SweptThrone"<br />
ENT.Contact = "sweptthr.one/contact"<br />
ENT.Spawnable = true<br />
ENT.AdminSpawnable = false<br />
ENT.Category = "STFood Neu"<br />
<br />
if CLIENT then<br />
    function ENT:Draw()<br />
        self:DrawModel()<br />
<br />
        local Pos = self:GetPos()<br />
        local Ang = self:GetAngles()<br />
        <br />
        Ang:RotateAroundAxis(Ang:Forward(), 90)<br />
        Ang:RotateAroundAxis(Ang:Right(), 270)<br />
        <br />
        local txt = "Serve Food!"<br />
        <br />
        surface.SetFont( "DermaLarge" )<br />
        local TextWidth = surface.GetTextSize( txt )<br />
        cam.Start3D2D( Pos + Ang:Up() * -15 + Ang:Right() * ( 5 + TimedSin( 0.25, 0, 2, 0 ) ) - Ang:Forward() * 1.5, Ang, 0.16 )<br />
            draw.WordBox( 4, -TextWidth*0.5, -260, txt, "DermaLarge", Color( 0, 0, 0, 200 ), Color( 255, 255, 255, 255 ) )<br />
        cam.End3D2D()<br />
        <br />
    end<br />
end</code></div>
</div>
<br />
<div class="codeblock">
<div class="title">Good Example</div>
<div class="body" dir="ltr"><code>-- GOOD, USE THIS EXAMPLE<br />
-- st_food_neu_stove.lua (shared)<br />
<br />
AddCSLuaFile()<br />
<br />
ENT.Type = "anim"<br />
ENT.Base = "base_anim"<br />
<br />
ENT.PrintName = "Stove"<br />
ENT.Author = "SweptThrone"<br />
ENT.Contact = "sweptthr.one/contact"<br />
ENT.Purpose = ""<br />
ENT.Instructions = ""<br />
ENT.Spawnable = true<br />
ENT.AdminSpawnable = false<br />
ENT.Category = "STFood Neu"<br />
<br />
ENT.RenderGroup = RENDERGROUP_BOTH<br />
<br />
if CLIENT then<br />
    function ENT:Draw()<br />
        self:DrawModel()<br />
    end<br />
<br />
    function ENT:DrawTranslucent()<br />
        local Pos = self:GetPos()<br />
        local Ang = self:GetAngles()<br />
       <br />
        Ang:RotateAroundAxis(Ang:Forward(), 90)<br />
        Ang:RotateAroundAxis(Ang:Right(), 270)<br />
       <br />
        local txt = "Serve Food!"<br />
       <br />
        surface.SetFont( "DermaLarge" )<br />
        local TextWidth = surface.GetTextSize( txt )<br />
        cam.Start3D2D( Pos + Ang:Up() * -15 + Ang:Right() * ( 5 + TimedSin( 0.25, 0, 2, 0 ) ) - Ang:Forward() * 1.5, Ang, 0.16 )<br />
            draw.WordBox( 4, -TextWidth*0.5, -260, txt, "DermaLarge", Color( 0, 0, 0, 200 ), Color( 255, 255, 255, 255 ) )<br />
        cam.End3D2D()<br />
       <br />
    end<br />
end</code></div>
</div>]]></content:encoded>
		</item>
	</channel>
</rss>