Author Topic: UI Grid Dynamic Resolution Adjustment  (Read 166 times)

bubucha

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
UI Grid Dynamic Resolution Adjustment
« on: August 09, 2017, 02:41:28 AM »
Hello,

UI Grid has the field maxPerColumn (maxPerLine). So the problem is that it doesn't readjust depending on the resolution, since UI Grid does it due to Flexible UIRoot.
For example, I have an inventory. It has UI Grid (and UI Scroll View). In 1024x768 there can be up to 6 items in a row (column, line), so I set it to 6. In the 1920x1080 it should be up to 9, but it is still 6, because UI Grid doesn't recalculate it.
So the question: There really is no solutions implemented for this case and I should do the logic by my hands, or am I missing something?
P.S Unity.UI has the solutions for this, so I wonder, is there really no such thing in NGUI.

Thanks in advance.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 316
  • -Receive: 1149
  • Posts: 22,027
  • Toronto, Canada
    • View Profile
Re: UI Grid Dynamic Resolution Adjustment
« Reply #1 on: August 12, 2017, 12:27:57 PM »
There's nothing built-in, and UIGrid was designed to be extremely simple, so that it's easier to tweak to your own desires. In your case you can actually write a trivial script that's basically one line of code in the Start() (or Update) -- GetComponent<UIGrid>() and set its number of rows based on the screen resolution.