Forum rules - please read before posting.

Inventory resizing when change resolution

Hi everyone,
AC 1.69.0 + Unity 2018.4.8f1 on a 2d game.

Hi, in these days I made the new Unity UI menus to link to AC menus and I follow the Resolution tutorial. All is ok but I have a little issue with the resize of the inventory menu when I change resolution at particular resolutions.
Here the results at different resolution (the correct one is 1920x1080):
1920x1080: https://drive.google.com/open?id=13x8pMRQunmda4Wt-2E95dg8eDXHGeMMC
1280x768: https://drive.google.com/open?id=1nasXByeM3_qgnj1QZRExBva1xCUyoKQX
720x576: https://drive.google.com/open?id=1C4ZPuPDmxmeZzuB1KH_PR9FX9Th9MJdx
640x480: https://drive.google.com/open?id=1fS4pYgx9yZ6cQheZ2RdHXvYNLaCE0DKh
All other menus are ok.

The actual inventory menu has 20 slot and the shift and right button are invisible (I want a "Fix" inventory). I tried Scale With Screen size (in canvas property) with Match Width Or Height to 0-0.5-1, but I can't reach the correct result for all the resolutions. In another thread someone suggests to force aspect ratio (in settings menu) to 1.7778 but seems not to work.
Is there some possible trick to solve it?

Thank you very much.

Comments

  • Each of the resolutions also change the aspect ratio. Are you locking your aspect ratio in the Settings Manager?

    AC won't affect your UI's display, so this seems to be more of a Unity UI issue. The upcoming v1.70 update, however, will introduce a new component called "Auto Correct UI Dimensions".

    When attached to a UI-based Menu's "RectTransform boundary", it can be used to re-position and re-size that RectTransform based on minimum and maximum anchor values. This allows, for example, the default Inventory menu to correctly span the width of the playable screen regardless of resolution or fixed aspect ratio. Hopefully it should be useful in this case as well.

  • Hi Chris: do you mean this Aspect ratio? https://drive.google.com/open?id=1qMKtaciZD-NgARGuTXLZmg6xqn8fzOkO or in some other place?

    In the project settings of unity (inside Player) I tried to uncheck the various Aspect Ratios, and it works correctly only with 16:9.

  • Yes, that's what I meant.

    Unity UI won't respond to the AC-enforced aspect ratio. The Canvas Scaler component will only react to the game window size. This is what the component I mention above should address.

  • Ok thank you, do you have a possible date for the upcoming v1.70?

  • I was planning for this week, but some last-minute showstoppers mean it'll likely have to be delayed a little longer, I'm afraid.

  • Don't worry, meanwhile I'm using AC version. Thank you.

  • Hello, sorry if I ressurected this discussion. Meanwhile I updated to 1.70.0 and with this version I made my game. Now I have a little issue: I'm improving the controller, but, if I read correclty, to move inside a menu (ex. options, inventory, etc) I need a Unity UI. Now I can't upgrade AC because the game is out and, with upgrade, probably some custom scripts break the game.
    But, also with 1.70.0 I have the same issue described (the inventory menu doesn't fit correctly when I change resolution).

    How can I solve? If the problem was corrected in the new versions, is it possible, in my case, to apply this correction to 1.70.0 (only the issue of inventory fit)?

    Thank you very much

  • I'm improving the controller, but, if I read correclty, to move inside a menu (ex. options, inventory, etc) I need a Unity UI

    You're referring to directly-navigating a Menu? Both AC and Unity UI menus allow for this, but you have to enable it at the top of the Menu Manager - i.e. check Directly-navigate menus when paused? to allow for direct-navigation of Pause menus.

    For Unity UI, you also need to configure which element is selected first. This can be done at the bottom of the Menu's properties.

    See the Manual's "Navigating menus directly" chapter for more details.

    But, also with 1.70.0 I have the same issue described (the inventory menu doesn't fit correctly when I change resolution).

    You need to make use of the new "Auto Correct UI Dimensions" component, which gets attached to the root Canvas object in your prefab. See the Manual chapter of the same name, as well as the updated UI prefabs in the /Assets/AdventureCreator/UI folder.

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.