Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: nah0y on August 06, 2012, 07:23:03 AM

Title: [Fixed] UIGrid vs UITable
Post by: nah0y 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 !
Title: Re: UIGrid vs UITable
Post by: PhilipC 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.
Title: Re: UIGrid vs UITable
Post by: nah0y 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.
Title: Re: UIGrid vs UITable
Post by: ArenMook 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.
Title: Re: UIGrid vs UITable
Post by: Malzbier on August 07, 2012, 09:16:48 AM
Thanks for explanation :) , UITable will be useful for dynamic content.
Title: Re: UIGrid vs UITable
Post by: nah0y 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"

:-)