on Nov 2, 2019 at 5:54:09 am Last Edited By Joe Richardson on Nov 2, 2019 at 6:47:45 am
Sorry for the confusing title.
I made a text layer that squares itself over time. So 1 copy becomes 2, 4, 6, 8 using a couple of For-Loops:
The problem Im having is that I want to keep the anchorpoint and the whole text centered every time it expands. For instance, at one second, "hello" is alone onscreen in the center of the composition. Then later on, it's 4 "hello"'s, -- and i'd like to keep it centered as it continues to square itself over time.
I sorta-get results using sourceRectAtTime, but I'm not sure how to keep it centered every time it expands. I figure it's a calculation in both the anchorPoint and position values that involves the amount the slider is on, but i'm not sure.
the 'square'. s = effect("Square Slider")("Slider");
var x = s // slider control that's keyframed;
var y = s;
var str1 = "";
var str2 = "";
for (i = 0; i < x; i++)
str1 += " hello "
for (i = 0; i < y; i++)
str2 += (str1 + "\r")
a janky solution was using sourceRectAtTime and setting the anchorpoint to height/2, width/2, and nudging the position of the layer til it's 'centered'
This should be the expression of your anchorPoint var myWidth = sourceRectAtTime(time,false).width;
var left = sourceRectAtTime(time,false).left;
var myHeight = sourceRectAtTime(time,false).height;
var top = sourceRectAtTime(time,false).top;