Forum rules - please read before posting.

Always fit within screen issue

edited January 2021 in Technical Q&A

Sorry for another thread (it's a different topic...)

I've Unity UI menu that shows description of action that being selected on hostpot (Like in MI special edition)
Always fit within screen? checked.
Appear type: On interaction
Position type: Appear At Cursor and Freeze
One Label element which being updated from global variable.
Text has content size fitter set to Preferred Size (in both axis)

In code, OnMenuTurnOn - it's updating the variable first thing.

The issue:
When I play the game and open the action menu on hostpot that is close to screen boundary
the text most of the time fit itself. but in some cases (which I can't tell what they are)
it is go beyond the screen.
I printed the text to log before updating the variable and it seems fine.

My gut feeling is that's a raise condition of when the 'fit' take place vs OnMenuTurnOn call to update variable.

Any suggestion?

Comments

  • My gut feeling is that's a raise condition of when the 'fit' take place vs OnMenuTurnOn call to update variable.

    The easiest way to determine that would be to have the menu close and re-open in the same place, with the same variable value.

    When AC positions a Unity UI menu - both to the cursor, and fitting within the screen - it does so by manipulating the "RectTransform boundary" object you assign in the Menu Manager.

    What is this currently set to, and - if this is not the same as your Text object - is that correctly placed inside the screen's boundary?

    As this is a visual issue, screenshots will be best shared if you can.

  • Cool, it works like you said :)

    In same function:
    1.update variable
    2.turn off menu
    3.turn on menu

    Thanks!

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.