-
Centering a dynamic square-expression-based text-layer
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.
Thanks
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")
}
str2a 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’