Layering GUI Screens and Sprites

I’ve made layers for my GUI Screen and have some Sprites I need to position in front of the screen. But I don’t know how to adjust the sprite’s layer to be in front of the GUI Screen.

can anyone please help me

gui.set_render_order(15) – using this line in init function to change the order for guis.

If you are wanting to use specific game object sprites and render them above the gui layer, you would need to make a separate material with a different render predicate, then you need to adjust your render script to draw that predicate AFTER it has drawn GUI. If you do not need the game object part of a sprite but just drawing something above, you can do as mentioned above and set the sprites to the top layer. But if you need it to specifically be a game object, you will have to modify your render script to do this as the default render script draws gui last and on top. There is documentation on the defold sight explaining the render script and how to do this.

2 Likes

Thanks for the suggestion, I will let you know how it works