How do I make DrawText appear on top of DrawMaterial?

Hi, currently I am creating a UI system which involves background images. Like pop up hints etc.

Most of my pop ups are images which include text, but I am creating a section which involves score, so it requires the text to be a variable.

I am trying to get the text to draw on top of the material, the way layers work in Photoshop. Currently no matter what order they are drawn in, the text is always below the material.

Any help would be greatly appreciated.

EDIT: Using a sequence to draw the material first fixed the issue (kind of) - however, I have three sets of text that draw based on 3 gates. So, this only works for the first section, any text drawn from the other gates are still behind the material.

Apologies, I fixed it myself, I had the first gated text end with a sequence that then entered the second gate and the third, this made the text draw on top of the background material.

I’m having the same issue but I don’t really follow what you are describing here. Could you explain that A bit more?

Ok, so the deal with this is you need to make sure that you are drawing the material before drawing the text just as Kenomica explained. However, if you’re doing something like I was and doing it in a loop it wont work.

If you have your draw material in a loop (I was drawing an inventory grid and looping on the items in the inventory collection) then you need a second loop to draw the text. Having a single loop with a sequence doesn’t work for some reason.

I ended up creating a loop to draw the materials for the items in the inventory and then I created a second loop to draw the stack size (my text that I needed) and used a sequence to enter both loops making sure that the loop for the textures came first and the text came second.