Forum Discussion
Flashcard Animation in Storyline
Next step...
first i add a variable for the scale... A number set to 2.5
As it is a Storyline variable i need to add this line to each Javascript trigger to get that value.var player = GetPlayer( );
To get the variable for the scale i use this code.var myScale = player.GetVar("scaling");
And then i can change the scale:2
everywhere to scale:myScale
Now you can easily change the scale... 2.5 is a bit too big when you test it.
2.07 perfectly covers all 4 cards. I do have a calculation somewhere to calculation the perfect percentage for things like this, but for now not using that as i dont want to complicate things.
So now the repositoning part...
Quite some solutions for that, but using the simplest one. I add a shape that has the position i want for the final scaled Cards. GSAP has a nice helper function 'getProperty'.
With that we can grab the postion of that element, and reposition our card to it.var xPos = gsap.getProperty(CTRL, "x", "px");
You can get any property from an element... height, width, whatever... if you add a second parameter as here 'px' the property is given back in pixels. If you dont add that, its more versatile. I seldom add that second parameter as i noticed it works better letting GSAP decide what unit to use. So like this...var xPos = gsap.getProperty(CTRL, "x");
At this point i have to focus on other projects.... will continue this later...