mirror of
https://github.com/brl/mutter.git
synced 2024-09-21 06:56:12 -04:00
acc28cf60c
Added an example showing how to reuse a ClutterAnimator instance to animate multiple actors at different times using an animatable rig, combined with reparenting.
125 lines
2.6 KiB
JSON
125 lines
2.6 KiB
JSON
[
|
|
{
|
|
"type" : "ClutterStage",
|
|
"id" : "stage",
|
|
"width" : 550,
|
|
"height" : 400,
|
|
"color" : "#333355ff",
|
|
|
|
"signals" : [
|
|
{ "name" : "destroy", "handler" : "clutter_main_quit" }
|
|
],
|
|
|
|
"children" : [
|
|
|
|
{
|
|
"type" : "ClutterRectangle",
|
|
"id" : "rect1",
|
|
"color" : "red",
|
|
"width" : 50,
|
|
"height" : 50,
|
|
"reactive" : true,
|
|
"signals" : [
|
|
{ "name" : "button-press-event", "handler" : "foo_button_pressed_cb" }
|
|
]
|
|
},
|
|
|
|
{
|
|
"type" : "ClutterRectangle",
|
|
"id" : "rect2",
|
|
"color" : "blue",
|
|
"width" : 50,
|
|
"height" : 50,
|
|
"reactive" : true,
|
|
"signals" : [
|
|
{ "name" : "button-press-event", "handler" : "foo_button_pressed_cb" }
|
|
]
|
|
},
|
|
|
|
{
|
|
"type" : "ClutterRectangle",
|
|
"id" : "rect3",
|
|
"color" : "green",
|
|
"width" : 50,
|
|
"height" : 50,
|
|
"reactive" : true,
|
|
"signals" : [
|
|
{ "name" : "button-press-event", "handler" : "foo_button_pressed_cb" }
|
|
]
|
|
},
|
|
|
|
{
|
|
"type" : "ClutterGroup",
|
|
"id" : "background"
|
|
},
|
|
|
|
{
|
|
"type" : "ClutterGroup",
|
|
"id" : "rig"
|
|
}
|
|
|
|
]
|
|
},
|
|
|
|
{
|
|
"type" : "ClutterAnimator",
|
|
"id" : "bounce",
|
|
"timeline" : {
|
|
"type" : "ClutterTimeline",
|
|
"id" : "bounce_timeline",
|
|
"duration" : 3000,
|
|
|
|
"signals" : [
|
|
{ "name" : "completed", "handler" : "foo_rig_animation_complete_cb" }
|
|
]
|
|
},
|
|
|
|
"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 ]
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|