Expressions/Scripts/Presets

Moderators: Disciple, zlovatt

 
PabloApiolazza
Topic Author
Posts: 1
Joined: Sun Jun 06, 2010 6:25 pm

Automated Podium

Mon Jun 07, 2010 11:31 am

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
 
kobyg
Posts: 128
Joined: Fri Dec 07, 2007 10:11 am

Re: Automated Podium

Thu Jun 10, 2010 5:37 am

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

Who is online

Users browsing this forum: No registered users and 1 guest