Author Topic: Changing UIGrid anchor point position without moving its children  (Read 4108 times)

sndwav

  • Guest
Hi.
I'm programatically changing a UIGrid's position inside a clipping panel.
The UIGrid is sorted, and has numbered children inside.

Lets say I move the grid, so the anchor point is now well outside the clipping panel.
The anchor point of the Grid is at its 1st child position... but if I remove the first few children from the grid, the grid's anchor point still stays at the position of that 1st child (which no longer exists).
If I do a Reposition, then it pulls all the children back to the anchor point (and outside the clipping panel)...

What I'm trying to do is to pull the anchor point back to the children's position.

Is there any way I can do this with a UIGrid?

Thanks!

(P.S: I also tried Repositioning after I remove the children and then moving the grid to the child's previous position, and I do end up with what I want, but there is a small flicker visible during the frame where the children are not inside the clipping panel, right after the reposition)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Changing UIGrid anchor point position without moving its children
« Reply #1 on: May 29, 2013, 12:10:06 PM »
That's not how the grid works. The grid always repositions its children to begin at the position of the grid, and extend to the right and below. It does not reposition itself. Ever.