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

Change Position of Text Depending on Value of Slider

Explorer ,
Aug 22, 2017 Aug 22, 2017

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

2.3K
Translate
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

correct answers 1 Correct answer

Advisor , Aug 23, 2017 Aug 23, 2017

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?

Translate
Contributor ,
Aug 22, 2017 Aug 22, 2017

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

The Language - Part I

Translate
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
Explorer ,
Aug 24, 2017 Aug 24, 2017

Thanks Davide this is what I was looking for. Cheers!

Translate
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
Advisor ,
Aug 23, 2017 Aug 23, 2017

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?

Translate
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
Explorer ,
Aug 24, 2017 Aug 24, 2017
LATEST

Indeed you are correct. I got so caught up in my expressions that I over complicated the issue. Cheers!

Translate
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