• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Text Box Message Question 2

Community Beginner ,
Jan 19, 2023 Jan 19, 2023

Copy link to clipboard

Copied

I wrote a series of expressions to help me create a ‘message’-like animation, where text boxes slide up from below the composition to a set spot in the composition. Each time a new text box slides up, the preceding text boxes will be pushed up. I’m using the auto-sizing text box preset from Adobe Bridge, and apply all of the expressions to the text layer each shape is connected to. Here’s the code I have written so far : 

 

y = thisComp.height;

y -= thisLayer.sourceRectAtTime().height + 175;

y -= (index - 1) * (thisLayer.sourceRectAtTime().height + 175);

[value[0], y]

 

y = thisComp.height;

y -= (thisLayer.index) * (thisLayer.sourceRectAtTime().height + 125);

[value[0], y]

 

height = thisLayer.sourceRectAtTime().height;

distance = 125;

y = thisComp.height - thisLayer.index * (height + distance);

[value[0], y]

 

If I jump into my composition, we start with the first text box, with lines of text inside : 

 

Screen Shot 2023-01-19 at 5.21.34 PM.pngScreen Shot 2023-01-19 at 5.22.38 PM.png

 

I've duplicated the text box, and the new text box appears at the bottom, in the same spot as the first text box. The first text box is pushed up. 

 

Screen Shot 2023-01-19 at 5.23.08 PM.png

 

I've duplicated it again, and the same happens as before.

 

Screen Shot 2023-01-19 at 5.23.45 PM.png

 

However, when I add a new text box, and change the height of it, so that it only has one line instead of two like the rest, the space between the boxes gets all wonky. 

 

Screen Shot 2023-01-19 at 5.24.17 PM.png

 

If I go ahead and add another box and change the height of the text again, returing to two lines, it gets even wonkier. Essentially, I want the distance in between each box to stay the same regardless of the heights of each box, and I've messed around with some soureRect functions, but none of them seem to be working out for me. Any help would be appreciated, thanks.

TOPICS
Expressions , How to , Scripting

Views

198

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 19, 2023 Jan 19, 2023

Copy link to clipboard

Copied

This confuses me:

>apply all of the expressions to the text layer

Where are you applying the three expressions? In any case, I think any auto-positioning scheme where the boxes can be different heights will require an expression that loops through all previous boxes and sums their heights. It looks like your calculation involves some version of index times box height, which assumes that all the boxes are the same height.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 19, 2023 Jan 19, 2023

Copy link to clipboard

Copied

Sorry for the confusion, I mentioned applying the expressions to the text layer as it's the text layer that the expressions go onto, not the auto-sizing text box, since the text box is connected to the text layer anyway and moves with it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 19, 2023 Jan 19, 2023

Copy link to clipboard

Copied

The confusion was due to the 3 different expressions. Still confused.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 19, 2023 Jan 19, 2023

Copy link to clipboard

Copied

LATEST

Sorry again then, lol. I'm applying them to the position property, if that answers the first question...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines