Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects keeping cursor of type-on text in constant position on screen

  • keeping cursor of type-on text in constant position on screen

    Posted by Tom Kemp on May 21, 2016 at 1:33 pm

    Hi there – a client has asked me to produce a simple animation of a long piece of code typing itself on screen character by character – with the cursor of the typing maintaining roughly the same position throughout (like typing on a piece of software where the text shifts up as you type each line)

    I had figured I would do this by animating the type-on and keying the position of the text box so the text is constantly scrolling upwards as the characters appear – however unfortunately due to the formatting of the code, with large gaps and indents, the characters are not typing at a constant rate – so it doesn’t sync up with the animated position of the text box.

    This method syncs up perfectly if I set the animation to type on line by line rather than character by character – but that’s not my brief. Is there possibly a way of the characters outputting at a uniform rate – or some how connecting the text box position or a camera to the write-on animation data? I have to create over a minute of this animation and so a clean, automated way of doing it is the only option I think.

    Many thanks!

    Kalleheikki Kannisto replied 10 years, 3 months ago 4 Members · 4 Replies
  • 4 Replies
  • Graham Quince

    May 23, 2016 at 10:00 am

    I’ve spent 30 minutes playing around with AE trying to get this effect for you and you’re right: there’s no easy way to do this.

    One possible option – and it seems a bit of a long way round but…

    You could pre-comp your text animation so that it animates down, then track the cursor so you can use it’s Y value to animate the position of your pre-comp. That way the cursor can move left-to-right, but as it moves down, your pre-comp will move up. Your cursor will stay in the same position vertically.

    http://www.YouTube.com/ShiveringCactus – Free FX for amateur films
    https://shiveringcactus.wordpress.com/ – FX blog

  • Kevin Camp

    May 23, 2016 at 10:09 pm

    if you use use an expression to do the type-on effect, you can use sourceRecAtTime() function to animate the position or anchor point to make the layer move up the page as each new line starts to type on.

    try this expression for the layer’s source text property:

    rate = 40; // in characters per second
    value.substr(0,time*rate)

    and then this for the anchor point:

    rect = sourceRectAtTime();
    y = rect.height;
    value + [0,y]

    the text should type on and move upwards with each new line.

    if you need to add a cursor (like maybe a | ) to the end of the text as it types on, that can be done too.

    Kevin Camp
    Art Director
    KCPQ, KZJO & KRCW

  • Tom Kemp

    May 24, 2016 at 11:54 am

    hey Kevin! thanks for your reply – I tried your method, the character writing expression works great, but when I try to add the anchor point expression I’m getting this error:

    Error at line 1 in property ‘Anchor Point’ of layer 2 (‘text’) in comp ‘Comp 2’.
    Function sourceRecAtTime is undefined.

    Any clues?

    Tom

  • Kalleheikki Kannisto

    May 26, 2016 at 9:17 am

    SourceRectAtTime() functionality was introduced in After Effects CC 2014.2.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy