Support => NGUI 3 Support => Topic started by: ranilian on June 17, 2012, 07:59:26 PM
Title: Possible addition to UILocalize
Post by: ranilian on June 17, 2012, 07:59:26 PM
mLanguage = loc.currentLanguage;
if(gameObject.GetComponent<BoxCollider>()!=null){
// Re-adjust the collider dimensions
NGUITools.AddWidgetCollider(gameObject);
}
To re-adjust the collider size of the text if it already has one on it.
Title: Re: Possible addition to UILocalize
Post by: ArenMook on June 17, 2012, 08:29:28 PM
The collider should generally be added to the parent game object, not to the localized label/sprite. For example, "button" game object instead of the background sliced sprite or the text label under it.
Title: Re: Possible addition to UILocalize
Post by: ranilian on June 17, 2012, 08:32:42 PM
That is true only if you have a background behind your text. In our case, the text is our button.
Title: Re: Possible addition to UILocalize
Post by: ArenMook on June 17, 2012, 08:40:26 PM
You can also create your own additional script with
void OnLocalize (Localization loc)
...function inside. Inside this function you can resize the collider accordingly.