Author Topic: UITable  (Read 55497 times)

PoN

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 111
    • View Profile
Re: UITable
« Reply #15 on: September 17, 2014, 09:21:17 PM »
i've tried your an advice , and look at the attachments , that happens after execute.

« Last Edit: September 17, 2014, 10:45:44 PM by PoN »
Worked on Doc&DogAge Of Fury 3D. Actually working on WarMach.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITable
« Reply #16 on: September 18, 2014, 05:21:03 PM »
Select one of your child game objects. Do you see where the transform gizmo is located? It's in the center. That's not the right pivot. As I mentioned, you need to change the pivot of the child items as well. Move widgets until the transform gizmo is in the right place.

PoN

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 111
    • View Profile
Re: UITable
« Reply #17 on: September 18, 2014, 09:15:43 PM »
yes, i've checked again , every child item has pivot - Center,Bottom, than i've run "Execute" of UITable , look at attachments pls
Worked on Doc&DogAge Of Fury 3D. Actually working on WarMach.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITable
« Reply #18 on: September 19, 2014, 10:03:48 PM »
You're right. I've just added a "Cell Alignment" option to the UITable that explicitly controls the content's alignment. You will find it in the coming update (3.7.3)

Andresfdezb

  • Newbie
  • *
  • Thank You
  • -Given: 10
  • -Receive: 0
  • Posts: 23
    • View Profile
Re: UITable
« Reply #19 on: October 02, 2014, 05:00:30 AM »
How is UITable.Reposition function used? I Have a table with rows generated and activated/deactivated dinamically at runtime (with the addchild function). So whenever I create new rows (or activate/deactivate any row, it's all in the same funciton) I call Reposition function afterwards, but it doesn't seem to work the first time I do it. The table actually takes a few calls to the function to reposition all its contents properly.
« Last Edit: October 02, 2014, 05:51:13 AM by Andresfdezb »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITable
« Reply #20 on: October 02, 2014, 11:10:01 PM »
Reposition() function collects all widgets underneath and calculates their dimensions. However if you've just enabled a game object, chances are its widgets haven't initialized yet. If you want widgets to init/refresh immediately, you need to use NGUITools.ImmediatelyCreateDrawCalls.

Andresfdezb

  • Newbie
  • *
  • Thank You
  • -Given: 10
  • -Receive: 0
  • Posts: 23
    • View Profile
Re: UITable
« Reply #21 on: October 03, 2014, 03:48:59 AM »
Reposition() function collects all widgets underneath and calculates their dimensions. However if you've just enabled a game object, chances are its widgets haven't initialized yet. If you want widgets to init/refresh immediately, you need to use NGUITools.ImmediatelyCreateDrawCalls.

I don't know why, but ImmediatelyCreateDrawCalls only works the first time I call it (it places every new widget on its place). The following times all the new widgets created (and activated if they were already created) are placed on top of each other overlapping. Does ImmediatelyCreateDrawCalls root parameter need to be the UIRoot? Or can it be the UITable...

(BTW I use a workaround to "solve" the issue of the Reposition not working with the newly created table rows by starting a coroutine that calls the Reposition() function in the following frame)
« Last Edit: October 03, 2014, 04:49:50 AM by Andresfdezb »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITable
« Reply #22 on: October 04, 2014, 08:08:10 AM »
You should pass the panel's game object to it.

Andresfdezb

  • Newbie
  • *
  • Thank You
  • -Given: 10
  • -Receive: 0
  • Posts: 23
    • View Profile
Re: UITable
« Reply #23 on: October 06, 2014, 08:21:46 AM »
You should pass the panel's game object to it.

Ok, thanks for the response.

cartman412

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: UITable
« Reply #24 on: December 04, 2014, 02:49:53 PM »
I am having some issues with the UITable as you can see in the image:



I want to add this title to the table but for some reason a huge space is added after it before the next element. This space also changes depending on the number of elements that follow. Any idea why this happens?

The pivot and the cell alignment of the table are both set to "top".

The first object is just a Label and it's size is the same as the letters you see.

Here is how the table looks without the label in it:



EDIT:

Here is the scene view:



and the structure in the hierarchy:



"Label" is just a UILabel gameobject. Note that "wordgrid" is actually an UITable, just haven't changed the name.

The reason why I added it to the table rather than to place it on the same level as the table is that the scroll view kept pushing the label down everytime I repopulated the table.

also here's how the table settings look like:



Hope this makes it clearer :)
« Last Edit: December 05, 2014, 06:54:49 AM by cartman412 »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITable
« Reply #25 on: December 05, 2014, 01:03:37 AM »
There must be something else there other than the label, or the label's width and height is actually much larger than what you suggested. I'd have to see what it looks like in the scene view. Why is that header a part of the table anyway?

cartman412

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: UITable
« Reply #26 on: December 05, 2014, 06:55:19 AM »
There must be something else there other than the label, or the label's width and height is actually much larger than what you suggested. I'd have to see what it looks like in the scene view. Why is that header a part of the table anyway?

I edited my question, if you could have a look again :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITable
« Reply #27 on: December 05, 2014, 03:16:18 PM »
Your label doesn't seem to be using a top pivot, while your table is. That said, I don't think it should matter. I see no reason for it to push other content down so far.

P.S. Why do you have that huge camera gizmo showing? Disable 3D gizmos via the menu on the top-right corner of your scene view.

Sprite101

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: UITable
« Reply #28 on: January 13, 2015, 07:34:36 PM »
I am really confused.  I've tried to follow the setup of the Quest Log example exactly, but I cannot tell what is telling the Table when to update.  There are zero collider events that point to the table and I'm getting particularly frustrated trying to get my implementation to work the way yours does.  Any help?

EDIT: Sigh... nevermind.  It turns out you HAVE to use TweenScale.  I was trying to use TweenHeight, which I don't think had the Update table checkbox.

EDIT AGAIN:  Turns out it does have an Update Table checkbox. 
« Last Edit: January 13, 2015, 07:44:43 PM by Sprite101 »

jamdalu

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: UITable
« Reply #29 on: September 01, 2015, 01:57:57 PM »
UItable is deactivated at runtime in unity 5 - is this a bug or known issue ?  I need to sort menu at runtime - please help!