Page 1 of 1

Automated Podium

Posted: June 7th, 2010, 11:31 am
by PabloApiolazza
Hi! I'm new here so first of all hello and what a wonderful site. I've been playing a lot with expressions long ago, and now I'm back, but kinda rusty.
Well this is my problem.

I have a scoreboard with precomps, each one with a text showing a number (the score).
Those texts are updated by a slider. So far so good.
What I want to do is to arrange this precomps one over the other according to the score. The higher the score, the higher the layer.
It would be great to have an expression to control the position and snap it accordingly to the number on the text layer, but I cannot think how.
Besides, I have four scoreboards, each with different amount of precomps, so the expression shouldn't be layer number sensitive.

I'm kinda on a rush so if anyone can help I'd be really grateful!

Cheers

Pablo Apiolazza

www.after-glow.com.ar

Re: Automated Podium

Posted: June 10th, 2010, 5:37 am
by kobyg
You could use the score as your Y-position. That would sort automatically higher score higher.
you could normalize it to the scale you want (if for example you know the score is from 0 to 100 you could divide by 100 to have a number between 0 and 1, and then multiply to have it in pixels for the Y-position. note that Y axis goes opposite to what you would want, since 0 is the top of the screen and 576 is for example the bottom of the screen in PAL resolution)

you could use something like (for the Position property):

score = slider(...choose you slider here...);
MaxScore = 100;
MaxYresolution = 576;
Ypos = MaxYresolution*(1 - score/MaxScore);
[value[0], Ypos]

Enjoy,
Koby