3D2D Layer trouble. Text on a background.

As you may see below, Draw.Simpletext has no problem being drawn on a black background, however, when using a white background (draw.roundedbox) the text seems to hide behind the background ( the picture is taken in transparency ) even though it is positioned in front of the background.

I have tried changing the text method and the background method to alternative libraries such as render, however all methods produce the same results

Here is my code:


function ENT:Draw()



	self:DrawModel()
	local pos = self:GetPos()
	local ang = Angle(0, LocalPlayer():EyeAngles().y, LocalPlayer():EyeAngles().r)
	ang:RotateAroundAxis( ang:Forward(), 90 )
	ang:RotateAroundAxis( ang:Right(), -90 )
	cam.Start3D2D(pos + vec, ang, 0.11)
	
		draw.RoundedBox(1, -125, -390, 250, 30,Color(255, 255, 255, 155))
		draw.RoundedBox(1, -125, -350, 250, 100,Color(0, 0, 0, 255))
	cam.End3D2D()

	
	ang = Angle(0, LocalPlayer():EyeAngles().y, LocalPlayer():EyeAngles().r)
	ang:RotateAroundAxis( ang:Up(), -90)
	ang:RotateAroundAxis( ang:Forward(), 90)
	

	cam.Start3D2D(pos + Vector(0,0.5,0), ang , 0.11)
	

		draw.SimpleText( "Gold Mine", "Trebuchet24", 0, -387, Color( 255, 255, 0, 255 ), TEXT_ALIGN_CENTER )
		draw.SimpleText( "Owned By:", "Trebuchet24", -115, -347, Color( 255, 255, 255, 255), TEXT_ALIGN_LEFT )
		if(self:GetNWEntity("owner") == NULL) then
		draw.SimpleText( "none", "Trebuchet24", 50, -347, Color( 255, 255, 255, 255), TEXT_ALIGN_CENTER )
		else
		draw.SimpleText( self:GetNWEntity("owner"):Nick() .. "", "Trebuchet24", 50, -347, Color( 255, 255, 255, 255), TEXT_ALIGN_CENTER )		
		end
		draw.SimpleText( "Production:", "Trebuchet24", -115, -325, Color( 255, 255, 255, 255), TEXT_ALIGN_LEFT )
		draw.SimpleText( "+10 gold", "Trebuchet24", 50, -325, Color( 155, 255, 155, 255), TEXT_ALIGN_CENTER )
		draw.SimpleText( "Speed:", "Trebuchet24", -115, -302, Color( 255, 255, 255, 255), TEXT_ALIGN_LEFT )
		draw.SimpleText( "1.0", "Trebuchet24", 50, -302, Color( 255, 155, 155, 255), TEXT_ALIGN_CENTER )
		draw.SimpleText( tostring(self:GetClass()), "Trebuchet24", 0, -280, Color( 155, 255, 155, 255), TEXT_ALIGN_CENTER )
	cam.End3D2D()
	
end

Apologies for the messy code - I tend to get frustrated sometimes.

I have not seen this problem being discussed before, so I thought I’d bring it up in hope of a solution

Thanks.

make the text or background a different color? also you should probably be trying to draw all of your stuff in 1 3D2D context instead of making a different one, using incorrect position math as well.

Drawing them both in the same 3D2D Plane completely removes the text. The problem is, I want to be able to use the color white or any color that wont tint the color of the text apart from black…

Regarding the positions, I’m unaware what this problem is - Its done off the entity position and rotated so it stands above the entity and angles towards the players eyes. I also believe that this is not the problem.

Draw your text AFTER drawing your roundedboxes in the same 3D2D context.

If you will draw boxes on top of the text, OBVIOUSLY the text will “disappear”.

And OBVIOUSLY, if you will draw WHITE TEXT on WHITE BACKGROUND the text will also “disappear”.

I was able to get the 2 planes onto 1:


function ENT:Draw()



	self:DrawModel()
	local pos = self:GetPos()
	ang = Angle(0, LocalPlayer():EyeAngles().y, LocalPlayer():EyeAngles().r)
	ang:RotateAroundAxis( ang:Up(), -90)
	ang:RotateAroundAxis( ang:Forward(), 90)
	cam.Start3D2D(pos + vec, ang, 0.11)
	
		draw.RoundedBox(1, -125, -390, 250, 30,Color(255, 255, 255, 155))
		draw.RoundedBox(1, -125, -350, 250, 100,Color(25, 25, 25, 175))

		draw.SimpleText( "Gold Mine", "Trebuchet24", 0, -387, Color( 255, 255, 0, 255 ), TEXT_ALIGN_CENTER )
		draw.SimpleText( "Owned By:", "Trebuchet24", -115, -347, Color( 255, 255, 255, 255), TEXT_ALIGN_LEFT )
		if(self:GetNWEntity("owner") == NULL) then
		draw.SimpleText( "none", "Trebuchet24", 50, -347, Color( 255, 255, 255, 255), TEXT_ALIGN_CENTER )
		else
		draw.SimpleText( self:GetNWEntity("owner"):Nick() .. "", "Trebuchet24", 50, -347, Color( 255, 255, 255, 255), TEXT_ALIGN_CENTER )		
		end
		draw.SimpleText( "Production:", "Trebuchet24", -115, -325, Color( 255, 255, 255, 255), TEXT_ALIGN_LEFT )
		draw.SimpleText( "+10 gold", "Trebuchet24", 50, -325, Color( 155, 255, 155, 255), TEXT_ALIGN_CENTER )
		draw.SimpleText( "Speed:", "Trebuchet24", -115, -302, Color( 255, 255, 255, 255), TEXT_ALIGN_LEFT )
		draw.SimpleText( "1.0", "Trebuchet24", 50, -302, Color( 255, 155, 155, 255), TEXT_ALIGN_CENTER )
		draw.SimpleText( tostring(self:GetClass()), "Trebuchet24", 0, -280, Color( 155, 255, 155, 255), TEXT_ALIGN_CENTER )
	cam.End3D2D()
	
end

however this did not solve my problem, the text is still hidden behind white backgrounds, also to clarify: I am not trying to draw white text onto a white background - Im trying to draw yellow/goldish text onto it. I have also tried rendering the background in different orders but the problem still persists, if anything it makes it more alpha.

Here is a better picture of the plane:

So instead of drawing white on white, you are trying to draw yellow on white, another physically unreadable combination?

It’s not hidden behind anything, it’s physically unreadable.

http://i.imgur.com/CsKgjvv.png

If you will look at this picture, you will see how impossible it is to read even on an image. In your case it is also worsened by the bloom effect.

If we mess around with levels, we can actually see that the text is actually there, but it’s impossible to read.

You should learn about contrast in UI design.

I will agree that this may be the case, so I decided i would change the text to rgb(255,0,0) Primary red. As you can see, the same effect occurs. Is there another way of drawing text and boxes that other people use, because I’m sure that people have used white backgrounds in 3D2D.

Try non Trebuchet24 font.

[editline]9th August 2016[/editline]

Or rather non additive font.

It turns out that Trebuchet24 is an additive font, I would never have found this out on my own. Thank you for sticking by until the issue was resolved.