Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions News Ticker (cropped text issue)

  • News Ticker (cropped text issue)

    Posted by Daniel Sleeth on December 5, 2013 at 12:18 pm

    I have read all the other news ticker posts that I could find using the search, but none seem to resolve the issue.

    I have made some news graphics with a ticker which scrolls some names across the red bar (see image below). The scrolling function works and it loops the text at the end e.g. in the image, after the last name “NAOMI CART” moves to the left, a few pixels later, the “• GIRLS TEAM…” follows it.

    This is almost perfect, but my problem is that my text layer ‘Ticker’ actually has a load more names after Naomi Cart, but because they are off the screen at the start of the comp, they don’t get included. Is there any way to adapt the expressions so AE scrolls the length of that layer instead of just the comp width of that layer? That way the whole ticker would be pretty much automated and I wouldn’t have to change the width properties each time I change the text length…

    https://images.creativecow.net/171222/screenshot2013-12-05at11.52.42.png

    Thank you in advance

    Mr Noob

    //Tile Centre
    offset = effect("Autoscroll - horizontal")("Speed (pixels/second)") * (time-inPoint) * (100/scale[0]);
    [thisLayer.width/2 + offset, thisLayer.height/2]

    //Output Width
    (thisComp.width / (thisLayer.width * (scale[0]/100))) * 100

    Kevin Camp replied 12 years, 5 months ago 2 Members · 4 Replies
  • 4 Replies
  • Kevin Camp

    December 5, 2013 at 11:25 pm

    the problem you are running into is that ae sees a text layer as the size of the comp regardless of whether the text all fits within the comp or not…

    what you could do is use a simple expression to have the text crawl:

    offset = 2;
    value-[0,timeToFrames(time)*offset)

    and then another for the source text to make it repeat:

    txt = text.sourceText;
    txt+txt+txt+txt+txt+txt+txt+txt+txt+txt

    you can just keep adding ‘+txt’ for as many times as needed to keep text on the screen for the duration of the comp.

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Kevin Camp

    December 5, 2013 at 11:39 pm

    the last line of the first expresion should be this:

    value-[timeToFrames(time)*offset,0)

    got x and y transposed…

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Daniel Sleeth

    December 6, 2013 at 11:08 am

    Thanks for your reply!

    txt = text.sourceText;
    txt+txt+txt+txt+txt+txt+txt+txt+txt+txt

    That is useful! Does that sourceText have a length that AE can use in an expression? i.e. take sourceText’s length and offset thisLayer by that value?

    UK Freelance Videographer

  • Kevin Camp

    December 6, 2013 at 8:20 pm

    [Daniel Sleeth] “Does that sourceText have a length that AE can use in an expression? i.e. take sourceText’s length and offset thisLayer by that value?”

    not exactly… sourceText is just the text that is typed into the layer. it does’t include anything about the size or font, it’s just the text.

    however, if you used a fixed width font, and measured the width of a character then you could use that to determine the width of the entire text string.

    so, say you used a fixed width font like courier, and you determined the width of a character at the point size your chose was 20px. you could use an expression like this to get the width of the string and then have it crawl and loop:

    chrW = 20; // value in pixels
    rate = 2; // value in pixels per frame
    txtW = chrW * text.sourceText.length / 2;
    x = (timeToFrames(time) * rate) % txtW;
    value-[x,0]

    to make the loop seamless you’ll need to make two instances of the sourceText, so this would go in the sourceText:

    txt = text.sourceText;
    txt+txt

    so that should make a looping crawl for any length of text.. though the original source text would need to be wider than the comp (or the crawl area of the screen).

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

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