Copy link to clipboard
Copied
I have a text that outputs the value of a slider I have set up. I would like the text to change position when it goes from 1 digit to 2 digits so that it will stay centered.
I was trying to create an If/then statement to do so. Here is how far I've come, I may be way off:
if (thisComp.layer("Control").effect("Slider Control")("Slider")>18) 956, 532;
So If the slider value is greater than 18 then the text position will be 956, 532.
Cheers,
Evan
evanc1244373 wrote
I have a text that outputs the value of a slider I have set up. I would like the text to change position when it goes from 1 digit to 2 digits so that it will stay centered.
I guess I must be missing something... but couldn't you just use centred paragraph alignment?
Copy link to clipboard
Copied
Something like this should work:
pos1 = [946, 532];
pos2 = [956, 532];
if (thisComp.layer("Control").effect("Slider Control")("Slider") > 18) {
finalpos = pos2}
else {
finalpos = pos1};
finalpos
Just edit the two positions pos1 and pos2.
The if else expression works this way: http://www.motionscript.com/mastering-expressions/language-beginning-4.html
Copy link to clipboard
Copied
Thanks Davide this is what I was looking for. Cheers!
Copy link to clipboard
Copied
evanc1244373 wrote
I have a text that outputs the value of a slider I have set up. I would like the text to change position when it goes from 1 digit to 2 digits so that it will stay centered.
I guess I must be missing something... but couldn't you just use centred paragraph alignment?
Copy link to clipboard
Copied
Indeed you are correct. I got so caught up in my expressions that I over complicated the issue. Cheers!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now