Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: yuyaokada on June 06, 2014, 05:30:33 AM

Title: Label issue
Post by: yuyaokada on June 06, 2014, 05:30:33 AM
How can I change text size without changing transform.localScale?
Title: Re: Label issue
Post by: Rajken on June 06, 2014, 06:14:38 AM
You will need to get the UILabel component and then set the fontSize if you want to do it from the code
else you can set it in the editor after you have selected a font to use for that label.
Title: Re: Label issue
Post by: yuyaokada on June 06, 2014, 06:28:14 AM
I wrote following code but I got an error " 'fontSize' is not a member of 'UILabel' ".

GameObject obj;
obj.GetComponent<UILabel>().fontSize = 0;
Title: Re: Label issue
Post by: Caio.Lib on June 06, 2014, 10:20:51 AM
yuyaokada, which is version of NGUI are you using?
This code works for me:

  1. gameObject.GetComponent<UILabel>().fontSize = 0;