How send a GUISking to back

Hi. and good morning.
my questionis how can I send to the back (leyering) please.

in other words. i am calling a PNG picture and GUISking appear over this PNG.
I need to send the PNG to front, or in reverse send the GUISking to the back please.

thanks for any help.!

I think, and I am quite sure Eric or dreamora will come in here and post the correct answer :o , that you can control the layering by altering the objects z component.

thanks for answer… but …I did not find where to change the ( Z ) value.

please, where do I search the z value ?
to send the GUISking to back ?

thanks.

I’m not on my mac right now so I can’t test this, but as far as I remember, the draw order has to do with the order in which you write them in code. For example:

OnGUI()
{
  Draw Button
  Draw PNG
}

will draw the PNG on top, whereas

OnGUI()
{
  Draw PNG
  Draw Button
}

will draw the button on top.

Again, I’m not at my mac so I can’t test this and I may have the order wrong, but the idea is that call order makes a difference.

My apologies. In looking up GUISkin i see i had something else in mind when i posted my recommendation.

I would take a look at this thread for GUI needs:

http://forum.unity3d.com/viewtopic.php?t=23557

  1. The gui is always on top of everything you do in 3D in case thats the question. you can’t have gui behind 3D

  2. Within the same OnGUI, the order in which you create the objects defines their depth

  3. with multiple ongui, you could use the depth settings on gui to define it.

that beeing said, 2 and 3 are both more or less a no problem on the iphone as you would avoid using ongui for the actual gameplay gui (use SpriteUI / GUIManager instead) but only main menu and multiple ongui are something you will likely avoid completely.