Author Topic: Resetting TypeWrite Effect  (Read 3124 times)

Iteis128

  • Guest
Resetting TypeWrite Effect
« on: October 04, 2012, 10:41:53 PM »
Hello,

I have the type writer effect attached to 2 different labels. These labels are always present in my scene, however the labels are just changed based on what you click and sometimes deactivate or reactivate using NGUITools.SetActive().

Since I am never destroying these labels any time, the type writer effect only runs through the first time you click on something. Is there a way, or a command you can use to reset the typewriter effect every time it is finished? Or better yet when it detects an label has been changed?

Thank you.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Resetting TypeWrite Effect
« Reply #1 on: October 05, 2012, 09:29:07 AM »
The typewriter script is just an example of how it can be used. It's the type of script you should modify to suit your needs.

Komikus

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: Resetting TypeWrite Effect
« Reply #2 on: October 06, 2012, 06:52:29 PM »
Delete the "else Destroy(this);" at the end of the script and make the mOffset variable public.
The you can reset the mOffset variable to zero anytime you want the effect to go again (i.e. after altering the UILabel text).