control object visibility layer

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By kietjay123

my game require many sprites laying on top of each other but is there a way to control which sprite is on top of which and change its visibility layers thx

:bust_in_silhouette: Reply From: jgodfrey

You can control which sprite is “on top” via its z_index property. Higher values will be drawn on top of lower values…

$Sprite.z_index = 10

Additionally, you can control the visibility of a given sprite its visible property. For example:

$Sprite.visible = false

If I have a Singleton / Autoload and want it to lay on top of my background , what to do , as z-index is not working ?

sarthakroy | 2020-07-30 03:29