Author Topic: Is there a way to make a flashing UILabel?  (Read 1511 times)

TokyoDan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 53
    • View Profile
Is there a way to make a flashing UILabel?
« on: November 17, 2014, 03:03:33 AM »
I want to make a message that flashes "Connecting..." when my game is accessing the internet. I want to do this with a UILabel. Is there an easy way to do this?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Is there a way to make a flashing UILabel?
« Reply #1 on: November 17, 2014, 09:22:18 AM »
  1. void Start() { StartCoroutine(FlashMyLabel()); }
  2.  
  3. IEnumerator FlashMyLabel()
  4. {
  5.     UILabel lbl = GetComponent<UILabel>();
  6.     for (;;)
  7.     {
  8.         lbl.enabled = !lbl.enabled;
  9.         yield return new WaitForSeconds(0.25f);
  10.     }
  11. }