Forum rules - please read before posting.

Render offset for menus

Hi there!

Here's an idea I think a lot of folks might find helpful :)

I would be great to be able to specify an X and Y render offset for each menu that would be taken into account during PlayerMenus.UpdateMenuPosition().

As it is, I either have to mess about with LateUpdate to override the calculation that has already been done, or I have to pull my hair out trying to get the UGUI elements to line up as a child object to a parent game object (which can be insanely complicated to get to work with "Always fit within screen" if the menu contains growing/shrinking UI elements such as for hotspot interactions).

A usual problem for me is that I have for example an VerticalLayoutGroup that should be positioned through "Follow Cursor" but shouldn't be rendered on the cursor but under it (while still always staying on the screen). Trying to add that margin through UGUI is an absolute nightmare, while if I just add an offset for that menu inside PlayerMenus.UpdateMenuPosition(), it works flawlessly.

Thanks

Comments

  • Sounds like a fair suggestion.

    It'd probably be in the form of a Menu property that you can control through script only - but it should be possible. I'll give it some thought.

  • edited May 2023

    Cool - yes, a script only version would be fine if you don't want to clutter the UI. The important thing from my perspective is that the offset would be applied whatever the position type is set to (personally I would need it "On Hotspot" and "Follow Cursor") 👍

  • In for v1.77.3 - use the Menu's PositionOffset script property to set an offset to reposition calls.

  • edited May 2023

    Does exactly what I needed.
    Thanks for squeezing it into this release - quite an insane turnaround time 🙂👏

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.