d4190cbf8c
Extracted the animation into its own JSON definition, then create a new script and get the animation each time a rectangle is clicked. Removes the need to reparent onto the background and copy property values to the rectangle after the animation, and generally much cleaner.
64 lines
1.3 KiB
JSON
64 lines
1.3 KiB
JSON
[
|
|
{
|
|
"type" : "ClutterGroup",
|
|
"id" : "rig"
|
|
},
|
|
|
|
{
|
|
"type" : "ClutterAnimator",
|
|
"id" : "bounce",
|
|
"timeline" : {
|
|
"type" : "ClutterTimeline",
|
|
"id" : "bounce_timeline",
|
|
"duration" : 2500
|
|
},
|
|
|
|
"properties" : [
|
|
{
|
|
"object" : "rig",
|
|
"name" : "x",
|
|
"ease-in" : true,
|
|
"keys" : [
|
|
[ 0.2, "easeOutCubic", 100.0 ],
|
|
[ 0.6, "easeOutCubic", 150.0 ],
|
|
[ 0.8, "linear", 350.0 ],
|
|
[ 1.0, "linear", 500.0 ]
|
|
]
|
|
},
|
|
{
|
|
"object" : "rig",
|
|
"name" : "y",
|
|
"ease-in" : true,
|
|
"keys" : [
|
|
[ 0.2, "easeOutCubic", 200.0 ],
|
|
[ 0.6, "easeOutBounce", 200.0 ],
|
|
[ 0.8, "linear", 200.0 ],
|
|
[ 1.0, "linear", 0.0 ]
|
|
]
|
|
},
|
|
{
|
|
"object" : "rig",
|
|
"name" : "scale-x",
|
|
"ease-in" : true,
|
|
"keys" : [
|
|
[ 0.2, "easeOutElastic", 2.0 ],
|
|
[ 0.6, "easeOutBounce", 4.0 ],
|
|
[ 0.8, "linear", 4.0 ],
|
|
[ 1.0, "linear", 1.0 ]
|
|
]
|
|
},
|
|
{
|
|
"object" : "rig",
|
|
"name" : "scale-y",
|
|
"ease-in" : true,
|
|
"keys" : [
|
|
[ 0.2, "easeOutElastic", 2.0 ],
|
|
[ 0.6, "easeOutBounce", 4.0 ],
|
|
[ 0.8, "linear", 4.0 ],
|
|
[ 1.0, "linear", 1.0 ]
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|