Author Topic: Trying to add text to a UILabel but I think I'm doing it wrong  (Read 2239 times)

benjaben

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
I'm trying to have text appear over time within an UILabel, but nothing is showing up onscreen when I run the corroutine. It works outside of the corroutine, but not within.

  1. string dialogue = "test";
  2. for(int i = 0; i < dialogue.Length; i++)
  3.                 {
  4.                         speechLoc.text += dialogue[i];
  5.                         yield return new WaitForSeconds(speed/dialogue.Length);
  6.                 }

Not sure if this how you do it properly, but it doesn't seem to be working.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Trying to add text to a UILabel but I think I'm doing it wrong
« Reply #1 on: March 12, 2014, 12:00:15 AM »
You mean like the TypewriterEffect script that comes with NGUI?