Hi, i’m still a newbie with defold and have some question.
I’ve make implementation for gui be positioned on according to the world axis and create a custom shader so the the gui is rendered on tile predicate on the render script
The gui has positioned correctly in the world axis, but the gui is always still rendered on top of other tile game object (even when the z index of the gui is behind the game object)
Is there anyway to make the gui be rendered according to the depth?
Thank you for your time and answer, i appreciate it
Yes, you can change the order of rendering in your render script. Look into render predicates:
…but before you do that, what is your use-case? If you want GUI text to exist like any other game object, then you should look into the label component instead:
Hi i’ve changed the render scripts, but the problem is i want the gui text is rendered on the same predicate with the tile predicate, so they can be seen according the depth (z axis)
But the problem is no matter what i do, the GUI is always rendered on top of the game object (even when they’re in the same predicate)
Rendering gui before / after the tile predicate will not make it rendered according the depth (z axis). So it need to be on the same predicate
My use case is i want to display status message on the middle of the enemy character. Enemy can have z position, some enemy are on the back of other enemy. So the status gui need to be rendered according to the depth
The problem using sprite / label game object is that when there is camera rotation, there will be a clipping issues with the status. So i need use GUI to make it render on one z index