Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Kardend on May 10, 2012, 01:41:07 PM

Title: GUI.Box always runs after GUI.Toggle and shows on top, no z-index?
Post by: Kardend on May 10, 2012, 01:41:07 PM
I have a question about GUI z index, I am trying to display a GUI.Box underneath some semi transparent GUI.Toggles, but no matter what I do I always get them to display below the Box. The box is also semi transparent so you see the game and the toggles below, but the toggles look dimmed with it on top.
They also still answer to touch/mouse clicks but I don't like how it looks and it has been bothering me for a couple of days.

I added some Debug.log to the code and see that the GUI.Box is always ran last no matter which change I make. I've added delays, made sure the toggles run after the box is already called but nope, still on top of the toggles.

I've also tried GUI.depth to no success.

Is the only solution running the actions in the order I want in the same fms and/or the same states?
At this point I have too many FSMs that I would like no to change, the GUI Manager FSM for the Main menu took me a while to finish and it's quite complex with a separate FSM for each toggle that works with global events triggering the actions.

Thanks!!


Title: Re: GUI.Box always runs after GUI.Toggle and shows on top, no z-index?
Post by: Kardend on May 10, 2012, 01:47:34 PM
All right, I've read this thread http://hutonggames.com/playmakerforum/index.php?topic=1492.0
I will try replacing the GUI.Box with a GUITexture instead see if I can make it show underneath the toggles.

I'll update the thread when I am done testing it.

Title: Re: GUI.Box always runs after GUI.Toggle and shows on top, no z-index?
Post by: Kardend on May 10, 2012, 06:19:13 PM
Well I made the transparent background work using a GUITexture in a GameObject, setting the Z to -1 and controlling the pixelInset properties with a custom action for easy access in my fsms.

It is just a pitty that the GUI depth cannot be controlled with playmaker.

anyway, thanks.