disappearing hud elements

so whenever I open chat or a vgui menu, some of my hud elements disappear, but only ones that use scissor rects, how do i stop this from happening?

Post the code first.
It’s rather funny that someone rated you informative even thought your post lacks the most basic info we need.

[lua]
render.SetScissorRect( (ScrW()/2) - ArmorDR/2, ScrH()/1.1, (ScrW()/2) + ArmorDR/2, ScrH(), true )
surface.SetDrawColor( Color( 0, 0, 200 ) )
surface.DrawPoly( ArmorBG )
render.SetScissorRect( 0, 0, 0, 0, false )
[/lua]

sorry, here.

You have to set the texture for DrawPoly. If you don’t want one then do draw.NoTexture() before the DrawPoly.

I used surface.DrawColor. The problem only happens when i open chat, and is gone when i close chat.

surface.DrawPoly requires a texture to be set. Other HUD elements (including engine-internal ones) are probably setting a texture before your call to surface.DrawPoly is reached, except for when the chatbox is opened, making it appear that you aren’t using a texture while you are really just using the texture set by some other code. Calling surface.SetTexture without any arguments or draw.NoTexture will fix the problem if this is the issue.

this gets rid of the color entirely, I don’t think you understand what is happening. I am trying to make it to where a certain hud element draws in a specific color, defined in the code I put, BUT, when I open chat, the color goes away for no reason. Using draw.NoTexture() gets rid of it entirely (the opposite of what i want)

bump

Do what hemirox said.
[lua]
draw.NoTexture()
surface.SetDrawColor( 0, 0, 0, 200 )
surface.DrawPoly( Polygon )
[/lua]

You can do

[lua]surface.SetMaterial(Material(‘vgui/white’))[/lua]

neither of those are working :expressionless:

I have tried setting materials, textures, and colors all in different combinations, but nothing works. Nothing any of you guys have recommended works, so i don’t know what to do. Here is the code, if you can find any problems and fix it, be my guest, but i can’t find any.