Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: 1337GameDev on December 22, 2013, 01:25:41 AM
-
I have a grid as a child of a scroll list, and I will dynamically add items to the grid and call reposition on the grid, but I also want a background UISprite to grow with the grid.
How do I get the height of a grid, to be able to fit my background to cover the grid area?
Do I have to count the number of grid elements, and calculate how long it is based on the cell height and such? I want to avoid this, as it seems hard to get perfect, and I am unsure how to get grid spacing amount.
-
Hmm, I don't think UIGrid knows anything about the total sizes directly like that.
You might be able to use the NGUIMath.CalculateAbsoluteWidgetBounds on the parent, since that takes children into account - but that might give you the FULL size.
I suppose you can also make the parent a sprite and have that follow that way with the new anchor/stretch system.