Author Topic: grid scrollview in the wrong position  (Read 8349 times)

vipo

  • Guest
grid scrollview in the wrong position
« on: July 08, 2014, 12:29:24 AM »
solved
« Last Edit: December 05, 2022, 03:02:55 PM by someone »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: grid scrollview in the wrong position
« Reply #1 on: July 08, 2014, 12:05:19 PM »
UICenterOnChild performs its initial recentering in its OnEnable() function, so if you happen to be moving stuff around you need to make sure that your script executes before UICenterOnChild, otherwise it won't work properly.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: grid scrollview in the wrong position
« Reply #2 on: July 09, 2014, 02:50:48 PM »
You shouldn't be disabling the UI camera. It's needed in quite a few places -- anchoring for example. There must always be a camera present that's able to see the UI elements. If there isn't, then you should disable the entire UI hierarchy, not just the camera. Also, a video of the issue would help, and make sure you have the latest version of NGUI.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: grid scrollview in the wrong position
« Reply #3 on: July 09, 2014, 03:57:33 PM »
Disabling the UICamera removes it from the list of cameras, making NGUI's elements unable to find it.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: grid scrollview in the wrong position
« Reply #4 on: July 09, 2014, 05:34:45 PM »
Well, all a grid script does is positions its children so that the first one is at the position of the grid, and others are to the right and below its position. The pivot point then controls how all the children get offset afterwards. So if it's bottom-right, then the bottom-right most object will be where the grid is, and others will end up above and to the left.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: grid scrollview in the wrong position
« Reply #5 on: July 09, 2014, 05:49:33 PM »
I'm merely giving you a generic overview of what the grid does. It's a pretty dumb component that re-arranges all children. I had to answer about 100 support issues today, so you referencing some other video really doesn't help either btw. I can't go hunting for it. :P