playMaker

Author Topic: Gui Overlapping!  (Read 6812 times)

Amy

  • Playmaker Newbie
  • *
  • Posts: 36
Gui Overlapping!
« on: May 01, 2012, 11:27:03 PM »
So I'm currently trying to build an inventory. I have a texture for an item and a texture for the actual inventory viewer graphic. The problem is I'm having trouble letting the card texture show ABOVE the inventory graphic. I'v tried adding "Gui Depth" but nothing seems to effect it. Any suggestions anyone? ><

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Gui Overlapping!
« Reply #1 on: May 02, 2012, 02:17:13 PM »
Are the textures drawn in different FSMs? Or the same FSM?

Amy

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Gui Overlapping!
« Reply #2 on: May 02, 2012, 04:21:28 PM »
They are different FSMs, one is a GUI button the other a GUI Box. Maybe I'm using them the wrong way?
« Last Edit: May 02, 2012, 05:00:48 PM by Amy »

kinetiknz

  • Junior Playmaker
  • **
  • Posts: 85
Re: Gui Overlapping!
« Reply #3 on: May 03, 2012, 09:43:59 PM »
Hey, this isn't a solution for your problem really, but I messed around with drawing GUI's with PM for a while, then I learnt ezGUI and find it immensely more useful in production. The GUI system is such a nightmare, I think the $200 is well worth it.

Amy

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Gui Overlapping!
« Reply #4 on: May 03, 2012, 10:46:59 PM »
Hey, this isn't a solution for your problem really, but I messed around with drawing GUI's with PM for a while, then I learnt ezGUI and find it immensely more useful in production. The GUI system is such a nightmare, I think the $200 is well worth it.

Was hard enough to buy playMaker for 95 xD I actually have decent Photoshop skills I just wish the gui depth worked as it should lol

Amy

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Gui Overlapping!
« Reply #5 on: May 04, 2012, 06:23:46 PM »
Anyone have any help? This should be pretty basic stuff.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Gui Overlapping!
« Reply #6 on: May 04, 2012, 08:28:13 PM »
So I did some digging on this...

It turns out GUI.depth only works when called from different scripts. It doesn't work when called from a single OnGUI.

Now it may look like GUI actions are called from different scripts, but under the hood PlayMakerGUI combines all GUI actions into a single OnGUI call. Most of the time this is a VERY good thing, resulting in huge performance gains, but in this case it's not so good since it breaks GUI.depth :(

This optimization was introduced in an update, so Set GUI Depth used to work, but now it doesn't do anything (as far as I can tell - Unity GUI seems to be a bit quirky).

I'll see if there's a way to fix GUI.depth, but in the meantime, you could:

- Draw the textures in the same state.
- Use GUITextures instead. These are easily layered with the Z coordinate.
- Or use some combination. E.g. GUITextures for the background and GUI actions for the foreground.


Amy

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Gui Overlapping!
« Reply #7 on: May 04, 2012, 10:04:39 PM »
So do you mean I have to make an in game object and texture it?  ???

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Gui Overlapping!
« Reply #8 on: May 04, 2012, 11:17:33 PM »
Unity has a built in system for this:
http://unity3d.com/support/documentation/Components/class-GuiTexture.html

It actually pre-dates the OnGUI system and is great for basic game UI stuff.

Playmaker GUITexture and GUIText actions are collected under the GUI Element category:
https://hutonggames.fogbugz.com/default.asp?W361

For example,  GUI Element Hit Test lets you send events when a GUITexture is clicked on.

inyourbus

  • Playmaker Newbie
  • *
  • Posts: 43
  • In Your Legends
    • In Your Legends
Re: Gui Overlapping!
« Reply #9 on: October 19, 2014, 01:04:44 PM »
Sorry to dig up an old topic. I have just ran into this issue. But all my GUI is in one FSM. "Main Menu"

But when you advance to the next state in the FSM, the previous states GUI fails to disappear. Also this only happens in Builds. When using uninty play mode the issue is not there. (I worked on a GUI in playmode only to get to where i am now)

I never seemed to have this issue before. But its completely stopped me in my tracks.

I am using GUI Layout, and have checked to make sure I am opening and closing the right way on each one gui element.

Pulling my hair out trying to get Photon to work using the GUI.

Followed the tutorial as best as I can from the documentation.

One more thing, when i try to import the photon demo files, No Playmaker actions/scripts/nothing is loaded in except for the scene objects. That happens on both of the demos. Any clue what I'm doing wrong here?

One step at a time..