Forum rules - please read before posting.

GUI or gameobject in front of ingame menu

edited September 2014 in Engine development
I am trying to get a custom gui element (health gauge) from playmaker to sit on top of an ingame menu. 

When I create this element, it is by default sent behind the ingame menu, regardless of the gui depth. 

Is there a way to change the "depth" of the entire menu system so that this custom gui sits on top of that?

Alternatively, would creating a 3d menu object be a better approach? 



  • Line 226 of StateHandler.cs is the call to display AC's Menu System:

    playerMenus.DrawMenus ();

    The depth isn't called specifically, so try forcing it by inserting the following line just before:

    GUI.depth = -2;

    (for example)  See what works - if there should be a "standard" depth, I'll incorporate it into AC official.
  • That did the trick, thanks. I used a depth of 1, and set the PM GUI to -2, and this seemed to work, strangely enough.

    I also had another thought about a way to use the AC menu sliders as gauges. If there is a way to link a slider to a global variable and also disable the slider's ability to change the variable, then theoretically it can be used as a simple gauge which displays the relative level of a variable, right?

    Just a thought anyway.

  • Being able to set AC GUI depth officially would be cool. I had the reverse issue earlier where the GUI from another plugin rendered behind an AC menu no matter what depth I gave it. This fixed it.
  • @hedgefied: Yes, I agree.

    @skitt2501: Excellent suggestion - it's already possible to link a Slider to a float Global Variable, but right now it'll always be "clickable".
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.