Skip to main content
Participating Frequently
March 10, 2020
Question

Autoscale: Textbox with fixed width and dynamic height, and responsive text.

  • March 10, 2020
  • 1 reply
  • 2312 views

Please note that I have a learning disability: I have dyslexia. Forgive me if you notice grammar errors etc. I try my best to ask good questions, but I am limited in terms of my disability to write things correctly. 

 

I have been using this expression to create an autoscale text box:

 

//size
s=thisComp.layer("asfdaf dfghf ");
w=s.sourceRectAtTime().width;
h=s.sourceRectAtTime().height;

[w,h]
//Box
s=thisComp.layer("asfdaf dfghf ");
w=s.sourceRectAtTime().width/2;
h=s.sourceRectAtTime().height/2;
l=s.sourceRectAtTime().left;
t=s.sourceRectAtTime().top;

[w+l,h+t]

However, thus code scales my textbox both length and width. What I am looking for is to have a fixed maximum width, with no spillover. If the text reaches the width it scales downward to fill in space otherwise, if you press enter the text goes to a new line and auto-scales to a maximum height. The box itself is responsive but only through its height.

 

Is this possible? I did see a plugin called pins and boxes, however, I don't have the budget to buy the pluggin at the moment.  

 

 

This topic has been closed for replies.

1 reply

Roland Kahlenberg
Legend
March 11, 2020

I think Danim Box may provide a solution - https://danim.com/creators/danim_box

 

Very Advanced After Effects Training | Adaptive & Responsive Toolkits | Intelligent Design Assets (IDAs) | MoGraph Design System DEV