Author Topic: UITable Sorting Clarification  (Read 5306 times)

BenChew

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
UITable Sorting Clarification
« on: December 11, 2013, 12:40:37 AM »
Hi, I'm trying to sort a GameObject in my UITable.

At first, it went well, the object snapped into the center when Played. Then, I added a Progress Bar to a Panel in the GameObject. This is where the GameObject snapped into another position that is totally not in the center of the UITable.

How does this sorting work? Or is there a miss that I should do when attaching other UI stuff as children?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITable Sorting Clarification
« Reply #1 on: December 12, 2013, 02:20:28 AM »
Table doesn't sort unless you enable alphabetic sorting. If it's not sorted, the order in which prefabs appear is arbitrary, and will vary from one platform to the next.

If sorting is enabled, it's alphabetic (not numerical). Meaning you should use names like "01" instead of "1" if you want it to be above "10".

BenChew

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: UITable Sorting Clarification
« Reply #2 on: December 18, 2013, 12:53:36 AM »
Sorry, I thought you didn't reply. Thanks for replying =D

And, it also seem that you might have not understood my question or you might have but changing the name did not solve it, so I'll just take some screens of the problem that I'm facing.

Here is an image before I enable the DarkBase and Label. The character sits well in the blue square.


This is an image after I enabled the other two, and now all three of them are off the center.



Any ideas? Thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITable Sorting Clarification
« Reply #3 on: December 18, 2013, 12:29:53 PM »
I'm guessing they all have different pivot points? The table works best when the pivot points of the items within are consistent. Top-left for example. Why are you using a table in this case anyhow?

BenChew

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: UITable Sorting Clarification
« Reply #4 on: December 18, 2013, 10:09:07 PM »
If I'm not mistaken, the pivot is where the arrows appear. They are all in its own center.

I'm using a table because the character is drag dropped into the square(and the other 2 items unhide), and then dragged to another square elsewhere, so I want it to be centered. Unless there is another tool that can achieve this.
« Last Edit: December 18, 2013, 10:20:35 PM by BenChew »

PaulGregory

  • Guest
Re: UITable Sorting Clarification
« Reply #5 on: December 19, 2013, 11:16:03 AM »
You may want to try having 1 column instead of 0 columns. Zero is a fairly silly default.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITable Sorting Clarification
« Reply #6 on: December 19, 2013, 12:24:35 PM »
If I'm not mistaken, the pivot is where the arrows appear. They are all in its own center.

I'm using a table because the character is drag dropped into the square(and the other 2 items unhide), and then dragged to another square elsewhere, so I want it to be centered. Unless there is another tool that can achieve this.
Yea, just by parenting them one to the other. The default pivot point is center. Tables align siblings.

You can also use anchors on the widgets to similar results. Either way though -- table is not what you should be using.