Author Topic: UITable construction "hide"  (Read 2964 times)

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
UITable construction "hide"
« on: November 16, 2012, 09:16:29 AM »
Hi !

Is there a way to hide everything in a UITable before the Reposition is complete for example ?
Right now, I have 2-3 frames were you can see that everything is misplaced and then perfect :(

sintua

  • Jr. Member
  • **
  • Thank You
  • -Given: 7
  • -Receive: 0
  • Posts: 63
    • View Profile
Re: UITable construction "hide"
« Reply #1 on: November 16, 2012, 10:14:10 AM »
I haven't tried it, but I believe you can loads them inactive (so they are not seen), adjust them (they should still have their shape you can see in the scene view), then loop through and turn them back on? Not sure if you'd see them all turning back on one at a time or not, though.

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: UITable construction "hide"
« Reply #2 on: November 16, 2012, 10:18:34 AM »
Well, I don't really know how I can load them inactive because I'm instantiating them.
And I think that Reposition does work only on visible objects :(

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITable construction "hide"
« Reply #3 on: November 16, 2012, 05:51:05 PM »
If they're being drawn in the wrong place, then you can try calling a Refresh on the panel, and/or broadcasting "CreatePanel" to your newly instantiated (and parented!) prefabs. You are using NGUITools.AddChild, right?

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: UITable construction "hide"
« Reply #4 on: November 19, 2012, 06:38:32 AM »
Yes I'm using AddChild, don't worry :)

I've tried Refresh but nothing changed, and what's the CreatePanel broadcast you're talking about ? What's used for ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITable construction "hide"
« Reply #5 on: November 19, 2012, 05:24:13 PM »
gameObject.Broadcast("CreatePanel");

Ensures that all widgets have registered themselves with their proper panels.