Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: xiaoniaojjj on September 21, 2012, 05:11:14 AM

Title: How to create a Box Collider to fit the Widget Size?
Post by: xiaoniaojjj on September 21, 2012, 05:11:14 AM
How to create a "Box Collider" easy to fit the size of Widgets. or only by Manual Hand?

Title: Re: How to create a Box Collider to fit the Widget Size?
Post by: dlewis on September 21, 2012, 06:04:15 AM
There is a convenience function will will either create a collider or re-size an existing collider to the size of the widget (including children). The shortcut in the editor is alt + shift + c and I think the code is in NGUITools.cs. I don't have the code open right now so I can't verify the class it's in, just look in the NGUI menu and search the code for the "make a collider" and you'll see where it is.
Title: Re: How to create a Box Collider to fit the Widget Size?
Post by: Nicki on September 21, 2012, 07:01:19 AM
NGUITools.AddWidgetCollider(GameObject); //returns the collider