Typewriter effect?

Typewriter effect?

Postby Skinnytorus » Sunday, 22.June 2014, 18:33

Hey guys,
I've been wondering how to make a typewriter effect in wz4 and here is what I came up with. Yes, it can deal with words and small sentences, but what if a long text needs to be animated? What about the flashing cursor? Any ideas?

Edit: I think we can achieve that effect by masking material's diffuse channel. But then we're gonna need a 'step' function which is not available in anim script wz4 language... Maybe modulo function could help?
You do not have the required permissions to view the files attached to this post.
Skinnytorus
Operator
Operator
 
Posts: 1299
Joined: Monday, 06.February 2012, 17:46

Re: Typewriter effect?

Postby ikam » Monday, 23.June 2014, 05:36

you can do a modulo with the % symbol, like that :

t:int = time*1000;
if(t%2)
// do something

(modulo is only available for int, so convert time (float range from 0 to 1) to int, multiply it by 1000 to get a int value ranging from 0 to 1000).
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: Typewriter effect?

Postby Skinnytorus » Monday, 23.June 2014, 08:58

Thanks very much for a very useful tip! :) I will try that this evening. One more question though: am I goona need a loop to make the motion 'cumulative'? Say, each time if(t%2) condition is true I would like to move the mask +0.1 unit relative to its previous position. How is it gonna look in code?
Skinnytorus
Operator
Operator
 
Posts: 1299
Joined: Monday, 06.February 2012, 17:46

Re: Typewriter effect?

Postby Skinnytorus » Monday, 23.June 2014, 18:23

OK now. Got it working. Here is the script. Paste it into Transform operator. The only thing left is to make it work with the mask for the text ;))
Code: Select all
t:int = int(time*128);
if(t%2) trans.x=t;
else trans.x=t+1;
Skinnytorus
Operator
Operator
 
Posts: 1299
Joined: Monday, 06.February 2012, 17:46

Re: Typewriter effect?

Postby ikam » Tuesday, 24.June 2014, 16:06

nice :)
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: Typewriter effect?

Postby CybeREX » Thursday, 26.June 2014, 06:03

Nice one =)
here is code for flashing light for example.
Code: Select all
t:int = int(time*128);
if(t%2) trans.x=sin(t);
else trans.x=sin(t);
CybeREX
Demomaker
Demomaker
 
Posts: 152
Joined: Thursday, 03.April 2014, 07:44

Re: Typewriter effect?

Postby Skinnytorus » Thursday, 26.June 2014, 08:42

Thanks. Will check that this evening.
Skinnytorus
Operator
Operator
 
Posts: 1299
Joined: Monday, 06.February 2012, 17:46

Re: Typewriter effect?

Postby Skinnytorus » Sunday, 23.November 2014, 05:33

Hey, guys.
I suggest a new strategy: use Debris. Have a look.
Any ideas how to get rid of the jugged edges? :-k
You do not have the required permissions to view the files attached to this post.
Skinnytorus
Operator
Operator
 
Posts: 1299
Joined: Monday, 06.February 2012, 17:46

Re: Typewriter effect?

Postby Skinnytorus » Sunday, 23.November 2014, 06:59

Found a better solution. Use the TronFont instead! :)
You do not have the required permissions to view the files attached to this post.
Skinnytorus
Operator
Operator
 
Posts: 1299
Joined: Monday, 06.February 2012, 17:46

Re: Typewriter effect?

Postby ikam » Sunday, 23.November 2014, 16:26

the 2 is perfect ;) well done
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: Typewriter effect?

Postby Skinnytorus » Sunday, 23.November 2014, 18:55

Thanks, man. I'm thinking about adding a cursor ;)
Skinnytorus
Operator
Operator
 
Posts: 1299
Joined: Monday, 06.February 2012, 17:46


Return to Support



Who is online

Users browsing this forum: No registered users and 2 guests

cron