Hi everyone,
AC 1.69.0 + Unity 2018.4.8f1 on a 2d game.
I have this situation: I open the inventory and then, clicking on some particular objects (ex. a letter, a poster, etc) a new graphic menu opens. Then I press ESC and I need the pause menu to open above the other menus so, when I resume the game or close it I can return to the same situation before opened it. Actually the pause menu overlap the menu inventory, but not the graphic menu like a letter or a poster (in this case the pause menu opens behind them).
Inventory and other graphic menus are made directly in Adventure Creator, while the pause menu is a Unity UI linked.
Thank you very much.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
The ordering of menus is dependent on their Source properties - see the Note box in the Manual's "Menus overview" chapter:
In order to have your Pause menu display above all others, you will either have to make it an AC menu, or make your other menus Unity UI-based. This is because AC-based menus rely on Unity's OnGUI system, which occurs after UI rendering.
Thank you very much Chris. With all Unity UI-based menus I can solve the problem (ex. I open the Inventory (this is a AC menu for the moment), then open a graphic menu (ex. a letter). Then I click ESC and the pause menu is above the other menus).
Now I'd like to improve some things:
thank you.
You can extend the UI's "RectTransform boundary" to extend to the game window's edges - that way clicks on it will still be considered "on" the Pause menu. If your current UI objects are dependent on the current RectTransform boundary's size, just create a new child of the Canvas, make it full-screen, and assign as the boundary that instead.
The "Crossfade" option will close all open menus in favour of the one you're crossfading to. For greater control, you'll need to do it via ActionList instead.
Set the e.g. Options button's Click type to Run Action List, and assign a new ActionList asset. In this asset, create two Menu: Change state Actions - one to turn off Pause, another to turn on Options.
Hi Chris, maybe I'm missing something:
-here you can see the pause menu (I create a GameObject as canvas child and attached a RectTransform (1920x1080)): https://drive.google.com/open?id=1wGrcrrV2lo4g3HDtin4G5gOCAndRTMdo
- here the letter menu: https://drive.google.com/open?id=19ort-Wwl6BxvTwOyMqXmMVwdxKZKG68S
- and here the area with issue: https://drive.google.com/open?id=12aDi37QJEwhQZYI7zjnaiyGtM1I_67ob.
In order the pause menu has a value of 2 while the letter one of 0 (so the pause menu is in front of the other one).
I put the pause menu in the scene and then drag the GameObject (with the RectTransform) on RectTransform boundary of AC Pause Menu and I can see a new Costant ID. Then I create a prefab of the menu and delete it from scene. In this moment the link to RectTransform boundary vanishes and remain only a label with the text Recorded CostantID: "number" that is the exact number of the CostantId of my GameObject. Is it correct?
Sounds like it. As I said, the Constant ID is how object references are retained after you delete it from the scene. So long as the field's ID value in the Menu Manager matches that on the GameObject in the prefab, it'll re-link at runtime.
Is there an issue?
No, but the red area on this image have a issue: https://drive.google.com/file/d/12aDi37QJEwhQZYI7zjnaiyGtM1I_67ob/view
I follow all the passages but when I click around the pause menu, where there are nothing behind, all works ok, but when i click on the the red ares (the overlapping of the two menus) it closes the letter menu, while I'd like nothing happens.
This may be a UI canvas/prefab configuration issue, since you're looking to make the new RectTransform boundary prevent clicks underneath it.
It may be a case of adding a Button component to the boundary, or a Canvas Group component that blocks raycasts.
On the AC level, I'm assuming that the Letter menu closes because you have a Button that performs this. You could try making this run an ActionList asset that uses Menu: Change state to turn it off, but only if the Pause menu is found to be off first (using Menu: Check state).
I tried with a button around the menu and it works. Thank you very much.