DrawText and DrawRect Stack order / z-index?

I have a basic “Game Over Screen” through draw text, and a rectangle that takes up the entire screen, is slightly opaque. Just to make it a little easier to read the text. The problem is the text is showing up behind the rectangle, regardless which I call first (drawtext then draw rect / draw rect then draw text). Looks like this, you can see the color of the rectangle is OVER the text. Just want to switch it:


If I was doing web design I could control this through z-index in CSS. How can I get that functionality here through blueprints?


Things that get drawn first are at the back and things layer on top. I myself haven’t had any issues like this, could you post a screenshot of you BP please?

Sorry for delay - big storm just came through and internet was down.

Here is how I have it setup currently:


I have also reversed it so the Draw Rect occurs first, and then the draw text happens, and I get the same result.

It is all coming through a single Event Draw HUD. I have the them split up through a sequence node way up the chain. Would that have any impact?

A larger perspective:


If so, how can I stack Draw Text and Draw Rect at the same time, and get the visual order I want?

Well first switch them around and compile because the way you currently have it, it will draw incorrectly.

I switched, compiled, didn’t get any errors and the results were the same:

Here is what my blueprint looks like now:


Something is up with the forum I think and I can’t post the resulting image - but I see it on screen, the rect is in front of the text.

Remove the line to the draw text to make sure it’s the correct text you are working with.

I think it may be happening because they are called right after each other.

Leave everything as is up to the draw rectangle node, remove the link from the draw text node, and then replace the input node for draw text by adding another pin on your main sequence node, and take that execution wire and plug it into the DrawText node. This will make sure it runs in the proper sequence, and hopefully is what you are looking for

Just wanted to see if that made any difference, let us know if it does or doesn’t work!

Hi everyone, I am an idiot.

@DarkHorror seems to be correct, I was confused with which of my drawTexts I had tried to layer on top of my drawRect. While my wires are a little messy now, it works!

Thanks for the input @DotCam.

Happy hump-day.