Page 1 of 1

Fast forward - typewriter effect

Posted: Tue Nov 24, 2015 9:30 pm
by nishant
Hi ,
In my dialogue UI , I have a small button which will be used to fast forward the dialogue text . Text has a typewriter effect on it . So in script how do I increase its typing speed ?

Thanks.
Nishant

Re: Fast forward - typewriter effect

Posted: Tue Nov 24, 2015 10:25 pm
by Tony Li
Hi Nishant,

Up to now, developers have requested that the continue button or fast forward button immediately fast-forward the dialogue text all the way to the end. The Continue Button Fast Forward component does this. It doesn't actually increase typing speed. Instead, it skips the typewriter effect immediately to the end.

If this will meet your needs, here's how you can set it up:

1. Add a Continue Button Fast Forward component to your button: Component > Dialogue System > UI > Unity UI > Controls > Effects > Continue Button Fast Forward. (Make sure to use the Unity UI version, not the legacy Unity GUI version.)

2. Inspect the Continue Button Fast Forward component. Assign the dialogue UI and the label with the typewriter effect.

3. Set your button's OnClick() handler to call the component's OnFastForward method.

For an explanation of how it works, see the "under the hood" section of the link above.



If you don't want to skip immediately to the end, and instead you want to increase the typing speed and let it continue typing at a faster speed:

1. Make a copy of UnityUITypewriterEffect.cs. (Import the latest Unity UI scripts from the Extras page.) Assign this copy to your Subtitle Line.

2. The script computes the typing speed at the beginning of the coroutine. Customize your copy so it recomputes the typing speed every frame.

3. Add a method that changes the typing speed. I recommend changing a temporary variable used by the coroutine instead of the public charsPerSecond field. This will leave the public charsPerSecond field untouched to allow the next line to play at its normal speed.

4. Configure your button to call the method in step 3.

Re: Fast forward - typewriter effect

Posted: Wed Nov 25, 2015 2:02 pm
by nishant
Yes that works ...

Thanks :)

Re: Fast forward - typewriter effect

Posted: Mon Jun 20, 2016 4:15 pm
by heyask
Hello

Why it is possible only in unity ui?

How can I use typewriter fast forward in NGUI?

Re: Fast forward - typewriter effect

Posted: Mon Jun 20, 2016 6:13 pm
by bohnstudios
Hi heyask,

Welcome to the forum! Just in case, here is the documentation to skip foward with NGUI.

http://www.pixelcrushers.com/dialogue_s ... UsePrefabs

As for fast forwarding, I'm not sure if Tony's second set of instructions would apply to NGUI, but I wouldn't be surprised if it's really close. Tony mentioned on another post that he was working on the 1.6.5 release today. He's usually pretty quick, but just a heads up that he's probably working on that....keeping Dialogue System rock-solid.... As for your question, I'm sure he will help you sort it out if the above info (combined with his last post) doesn't work :)

What kind of game are you working on? (if you can share)

Cheers,
Ron

Re: Fast forward - typewriter effect

Posted: Mon Jun 20, 2016 7:09 pm
by Tony Li
Hi,

I'm here. :-)

There's an incorrect statement in the NGUI Support documentation. In the upcoming 1.6.5, it's been fixed to this:
...add an NGUI Continue Button Fast Forward component. Assign the dialogue UI and the typewriter effect to
the component, and change the continue button's OnClick event to call the component's OnFastForward method.
The NGUI Continue Button Fast Forward component is in the latest NGUI Support package. You can download it from the Dialogue System Extras page or right here: NGUI3_Support_2016-06-20.unitypackage