HUDPaint, Create text on top of a drawn box?

Trying to put the text on top of the box.
Reversing the order doesn’t seem to help.

I want to place a box on the screen with text on top of the box.



x = ScrW() /2
y = ScrH() /2

hook.Add("HUDPaint", "paintCardz",function()
	
	draw.SimpleText( bob, "Trebuchet24", x, y+20, Color(255,50,50, 255),0,4 )	
	
	draw.RoundedBox( 5, x, y, 150, 250, Color(255,255,255, 200) )
	
end)


If you don’t want to use x, y outside the file then local them.
Ergo:
[lua]local x = ScrW() / 2
local y = ScrH() / 2[/lua]

Reversing order should work altho there is an error in your code (if that’s a full code).
‘bob’ is unassigned.

Yeah. It’s nil, I wasn’t worried about changing that.
Reversing the order doesn’t seem to work though.

Update:



local x = ScrW() /2
local y = ScrH() /2

hook.Remove("HUDPaint", "paintCardz")
hook.Add("HUDPaint", "paintCardz",function()	

draw.RoundedBox( 5, x, y, 150, 250, Color(255,255,255, 255) )

draw.SimpleText( "test", "Trebuchet24", x, y+20, Color(255,50,50, 255),0,4 )
	
end)


Show me a screenshot.

Reversed:

I lowered the transparency for the box to 150.

Are you sure that file has reloaded?
Put a print on top of the script out of any function and after editing it that should print in console, if not, its just running the same code

[editline]3rd November 2015[/editline]

And it hasnt reloaded

that code should work fine, you are drawing the box first and then the text on top of it.

It’s reloading.

[editline]3rd November 2015[/editline]

The box seems to take higher priority over the text no matter what order the functions are placed.
I’ll investigate further when I get back.

the issue is with the font you’re using, use another one

Or if you changed hook name previously, it could still be there - hooked and drawing.
Try doing a changelevel

Thank you everyone, the font was the problem.