Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: schwarzenego on November 18, 2015, 04:55:48 PM

Title: Window resize based on content
Post by: schwarzenego on November 18, 2015, 04:55:48 PM
Hey,

I've been using NGUI for quite some time now and always avoided doing this... but now would be a good time to know if there is an "easy way" to do it. What I want to achieve is this:

http://www.teeteehaa.de/gc/gamescom2010/images/guildwars2-skills8-feralsignet.jpg

Imagine that the background is a widget, the items inside are ordered by a grid, and I want the grid to control the size of the parent widget, based on how many items are in the grid. Is there an "automatic" way to do it? I know it wouldnt be hard to calculate the size based on the widget's variables, but what if this was a Table for exemple? Is this at all possible by "NGUI Native" ways?

Thanks!
Title: Re: Window resize based on content
Post by: ArenMook on November 25, 2015, 04:46:17 PM
EnvelopContent script can resize a widget based on the bounds of the root object you provide. Use it to automatically resize the background sprite.