Text rendering respecting gui render order

Hey,

Is it possible to get an update on the current situation/plan for text GUI nodes and their lack of respect for the GUI render order? Currently, if you have text nodes on a GUI interface, it doesn’t matter if you place another GUI over the top of that with a higher render order, as text is rendered in a separate predicate.

@Ragnar_Svensson mentioned something about this being something you were looking into last year, is this still the case? It’s rather horrid to have GUI text elements suddenly pop in over the top of a loading screen, as just one use-case example.

2 Likes

This should absolutely work, @britzl will check what the status is.

2 Likes

Yes, this is working as intended. I put together a crude example with two overlapping GUI scenes with box and text nodes where you can change render order of the two scenes: http://britzl.github.io/publicexamples/gui_render_order/

(code: https://github.com/britzl/publicexamples/tree/master/examples/gui_render_order)

2 Likes

It seems the issue only exists for certain text nodes, not all of them. The following things are unique for the text node that’s showing up over the load screen when its GUI is enabled:

  • It’s using the ‘system’ font.
  • It has an alpha of 0.5, rather than 1 like the rest.

The GUI for it is on 5, the loading screen is on 6 and there’s a blackout on 7. Once the GUI on 5 is enabled, the text nodes with those unique differences appear over the top of 6 and 7, regardless.

1 Like

Ah, the system font is something else completely. You should not use that other than for debugging purposes I think.

4 Likes

I was not aware that specific font was being handled differently in the rendering process. That explains the issue, thanks.

1 Like

To explain further:

  • The system_font.font uses the system_font.material which has the tag text.
  • Other fonts have by default the font.material which has the gui tag.

In the default renderscript it looks like this:

render.enable_state(render.STATE_STENCIL_TEST)
render.draw(self.gui_pred)
render.draw(self.text_pred)
render.disable_state(render.STATE_STENCIL_TEST)

This means that fonts using the gui tag will of course be rendered together with and ordered like the box and pie nodes. But the system_font has the text tag, and as can be seen above it will always be drawn after and on top of the gui.

6 Likes

Thanks for clarifying that for me. You’re an awesome gnome.

2 Likes

Thanks!

4 Likes

Can there be a sentence or a side note put into the rendering order section of the gui manual about this? I’m sure I’m not the only one who used the system font for prototyping and ran into this issue. A note in the docs would save some time and frustration.

3 Likes

Good point! @sicher?

@ross.grams, you could use the “Spotted an error?” button bottom right on every page to report these things to make sure they end up on @sicher’s table.

1 Like

OK, will do next time.

1 Like

Sorry for doing thread necromancy, but a “do not use system_font because of the material tag” should definetely be written with red background somewhere in the GUI doc.
I spent an hour tweaking Z axis, layers and gui rendering orders, until I found this post.

Thanks :slight_smile:

7 Likes

@sicher Can we make this more clear in our documentation?

2 Likes

And also, a reminder. Please feel free to suggest changes directly on the documentation page! Simply click the “Spotted an error?” button at the bottom right of the page.

4 Likes