Author Topic: NGUI Grid to start in selected position?  (Read 3487 times)

schellenberghq

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 31
  • Game Programmer
    • View Profile
    • Blog
NGUI Grid to start in selected position?
« on: August 01, 2013, 10:57:31 AM »
I have N amount of items dynamically loading into my horizontally scrolling grid when the scene is loaded. I also have the CenterObject script on my grid. I'm having a hard time getting a specific item to be the focused object in the center because the grid always repositions the items with the left side being the start point. Does this make sense? Any ideas?

Thanks,

-Jacob
---------------------------
Jacob S.
Game Programmer
---------------------------

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI Grid to start in selected position?
« Reply #1 on: August 01, 2013, 05:44:57 PM »
CenterObject? Do you mean UICenterOnChild? It performs its task in OnEnable, and UIGrid does its thing in Start, which happens after OnEnable calls. You might want to delay enabling UICenterOnChild until after the end of frame instead.