Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Dedede on May 18, 2012, 02:33:27 PM

Title: Change Color Tint of UILabel?
Post by: Dedede on May 18, 2012, 02:33:27 PM
Hey guys,

is it possible to change the color tint value of an UILabel at runtime?

I can only find effectColor, which as the name implies only works, if effects are used.

Thanks.
Title: Re: Change Color Tint of UILabel?
Post by: Ferazel on May 18, 2012, 03:11:30 PM
UILabel inherits from UIWidget which has a .color property: http://www.tasharen.com/ngui/docs/d1/d68/class_u_i_widget.html#a70d22f68e64f19372b1eaab899abf975
Title: Re: Change Color Tint of UILabel?
Post by: Dedede on May 18, 2012, 03:33:14 PM
Thanks Ferazel,
it works like a charm :)
Title: Re: Change Color Tint of UILabel?
Post by: tinyutopia on April 17, 2013, 03:06:48 PM
This is a dead link
Title: Re: Change Color Tint of UILabel?
Post by: Lohoris on September 17, 2013, 04:31:06 AM
This is a dead link
Dead link indeed.
Title: Re: Change Color Tint of UILabel?
Post by: ArenMook on September 17, 2013, 02:55:20 PM
  1. UILabel lbl = GetComponent<UILabel>();
  2. lbl.color = Color.red;
Title: Re: Change Color Tint of UILabel?
Post by: skatola on January 31, 2016, 06:35:20 AM
  1. UILabel lbl = GetComponent<UILabel>();
  2. lbl.color = Color.red;

sorry, what if i want change just a part of a uilabel?
for example: uilabel_text = "Hello World[/color=#2b2b2b]";
Title: Re: Change Color Tint of UILabel?
Post by: ArenMook on January 31, 2016, 08:37:33 AM
  1. label.text = "Hello [ff0000]red[-] world";
It's explained in the documentation for UILabel, even shown in the picture. http://www.tasharen.com/forum/index.php?topic=6706.0