ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Random speed typewriter with a blinking cursor

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Icaro Lobo
Random speed typewriter with a blinking cursor
on Dec 1, 2018 at 8:28:47 pm

I've been using this Dan's expression:
minRate = 3;
maxRate = 6;
charCount = 0;
t = inPoint;
seedRandom(index,true);
while (t < time){
charCount++;
t += framesToTime(random(minRate,maxRate));
}
value.substr(0,charCount)


and I want to add a blinking cursor ("|") and the end but can't figure it out.

Can anyone point me in the right direction?

Thanks.


Return to posts index

Dan Ebberts
Re: Random speed typewriter with a blinking cursor
on Dec 1, 2018 at 9:05:07 pm

Play around with this:


minRate = 3;
maxRate = 6;
blinkRate = 2;
charCount = 0;
t = inPoint;
seedRandom(index,true);
while (t < time){
charCount++;
t += framesToTime(random(minRate,maxRate));
}
value.substr(0,charCount) + (Math.floor(time*blinkRate)%2 ? "|" : "")



Dan



Return to posts index

Icaro Lobo
Re: Random speed typewriter with a blinking cursor
on Dec 1, 2018 at 9:11:12 pm

Dan, thank you very much.
Is there a way to change the color of the cursor itself?


Return to posts index


Dan Ebberts
Re: Random speed typewriter with a blinking cursor
on Dec 1, 2018 at 9:17:08 pm

Change the last line to this:

value.substr(0,charCount) + (Math.floor(time*blinkRate)%2 ? "|" : " ")

Then add a Fill Color animator, add an Expression Selector, and add this expression to the Expression Selector's Amount property:

textIndex == textTotal ? 100 : 0


Dan



Return to posts index

Icaro Lobo
Re: Random speed typewriter with a blinking cursor
on Dec 1, 2018 at 9:21:04 pm

Dan, this works partially for me. When the cursor is not on the "ON" state(showing), the last letter is red.
How to apply the color only to the cursor itself?

Thanks again.


Return to posts index

Dan Ebberts
Re: Random speed typewriter with a blinking cursor
on Dec 1, 2018 at 9:24:27 pm

Did you change the last line of the Source Text expression to this:

value.substr(0,charCount) + (Math.floor(time*blinkRate)%2 ? "|" : " ")


Dan



Return to posts index


Icaro Lobo
Re: Random speed typewriter with a blinking cursor
on Dec 1, 2018 at 9:29:08 pm

I did, the last letter is red when the cursor is not on the screen.


Return to posts index

Icaro Lobo
Re: Random speed typewriter with a blinking cursor
on Dec 1, 2018 at 9:31:28 pm

Sorry, I redid it and it worked. As usual, the operator was the error.

Thanks a lot!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]