Another GUI render order question (SOLVED)

Hi everyone

I went trough the GUI manual, read a lot of posts but I can’t figure out why my GUI is not following the rules.

So here is what is happening:
Whenever I display text in a GUI, it is always drawn on top of anything else. I am not using the system_font (I’ve read in a post this can cause problems). It does not seem to follow the order of the hierarchy nor does it follow the rules when using layers.

Here are two screenshots. One from my outliner and one from a rendered screen. For this example I disabled all code going with this GUI so it should not influence the graphics in any way.
The “are_you_sure_menu” node is at the bottom and should be rendered last and on top of everything else but it doesn’t. I have also put every item of the menu in the “Window” layer which is also at the bottom. The “testText” node is the “Text” layer and the “testBox” is in the “Graphics Box” layer. Still the test text and the item text is on top of my are_you_sure_menu".


Is there anyone who can shed a light on this? Am I doing something wrong here?

Thanks much

If you are using layers you need to make sure to assign the correct layer to all of your nodes. If you don’t assign a layer I believe the node will inherit the layer from its parent. Double check everything! If it still doesn’t work then reduce to a minimal example and share here!

Thanks for your comment. I have reduced the complexity by removing unnecessary nodes. Every box and text node has a layer attached. There is still a bunch of code/graphics in other sections of the program which I didn’t delete as it will break the whole game. This GUI is a stand alone section which is called from a button in another section. As mentioned before there is no code active in this GUI. I am using a ttf font.

Layer assignments:
testBox -> Graphics Box Layer
testText -> Text Layer
are_you_sure_menu -> Window Layer
are_you_sure_text -> Window Layer

That being said I have noticed something while looking at our font asset. It uses the /builtins/fonts/system_font.material . Could this be the issue? I saw something in another post that the system font has different behaviour. Does my font need a material of its own?

Thanks much

Ok, I figured it out!
It is indeed the material which is the culprit. I thought that a different font would do the trick but it is also the material the font uses which has to be changed from font-df.material to font.material.

Thanks for helping me out.