My hunch is the answer is no based on reading the docs, but can you set layer.states.animationOptions to each individual state? I want different curves for each state.
Great question Ricardo! You can set the curve on each state call.
layer.states.switch "newState", curve: "spring(300, 35, 0)"
OR you can pass in a variable that has a curve
testCurve = "spring(300, 35, 0)"
layer.states.switch "newState", curve: testCurve
Here's a shorthand version:
layer.states.switch "one", curve: "spring(100,10,0)"
Boom! Beautiful! Thanks so much :)
Anytime Ricardo, cheers Balraj Chana!
Benjamin can we add this?
Benjamin Den Boer - Quit slacking and add this in there... It's been brought up so often! :D
Benjamin Den Boer (Anonymous member from the crowd) Yeah, what that guy said! :P.
Hahah okay okay Jordan & Joshua - adding this now! ;)http://framerjs.com/docs/#layer.states.animationOptions
Ben wakes up. Ben fixes Framer. Ben goes to sleep.
Ben is awesome. End of story.
Is it possible with states.next to set different animation options for each state?
I would like to add a 1 second delay when changing to state A but no delay to state B.
Something like the below:
layer.states.next("stateA” delay: 1, "stateB” delay: 0)
Steve Gale - animationOptions can't be passed within the layer.states.next() method yet. You can always use conditional statements within the event that contains the .next() method, though:
if layerA.states.current is "stateA" ____layerA.states.animationOptions = delay: 1
That'll do me just fine! Thanks, Ben.