Author Topic: [Fixed] UIGrid vs UITable  (Read 7684 times)

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
[Fixed] UIGrid vs UITable
« on: August 06, 2012, 07:23:03 AM »
Could you explain briefly what's the difference between using a UIGrid and a UITable ?
And in what case should we use one instead of the other ?

Thanks !
« Last Edit: August 08, 2012, 03:13:15 AM by nah0y »

PhilipC

  • Guest
Re: UIGrid vs UITable
« Reply #1 on: August 06, 2012, 10:41:56 AM »
At the top of each of those classes we have a summary of what it does.

UIGrid "All children added to the game object with this script will be repositioned to be on a grid of specified dimensions."
UITable "All children added to the game object with this script will be arranged into a table with rows and columns automatically adjusting their size to fit their content"

So UIGrid will just arrange the items into formation. UITable will resize the elements.

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: UIGrid vs UITable
« Reply #2 on: August 06, 2012, 11:55:13 AM »
Thanks for the answer,

I've never, ever seen any example where the UITable resize elements. I mean, I don't understand how they will be resized since there is the MakePixelPerfect that would make them their correct size.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIGrid vs UITable
« Reply #3 on: August 06, 2012, 01:43:22 PM »
UITable changes "cell size" to the dimensions of the widgets within. Grid stays at fixed size. Check the quest example to see how one cell's size change affects others -- by effectively moving them.

Malzbier

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 93
    • View Profile
Re: UIGrid vs UITable
« Reply #4 on: August 07, 2012, 09:16:48 AM »
Thanks for explanation :) , UITable will be useful for dynamic content.

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: UIGrid vs UITable
« Reply #5 on: August 08, 2012, 03:13:03 AM »
Yup, your last explanation is really more clear than the ones in the docs.

I'll stay with : "UITable changes "cell size" to the dimensions of the widgets within. Grid stays at fixed size"

:-)