mirror of
https://github.com/brl/mutter.git
synced 2025-02-02 23:03:00 +00:00
docs: Describe the Animation definition syntax
The ClutterAnimator documentation needs a section on the syntax of its ClutterScript definition, possibly with an example.
This commit is contained in:
parent
4dd11d6915
commit
6ab90899ba
@ -37,6 +37,65 @@
|
|||||||
* through the #ClutterScript definition format, but it comes with a
|
* through the #ClutterScript definition format, but it comes with a
|
||||||
* convenience C API.
|
* convenience C API.
|
||||||
*
|
*
|
||||||
|
* <refsect2 id="ClutterAnimator-script">
|
||||||
|
* <title>ClutterAnimator description for #ClutterScript</title>
|
||||||
|
* <para>#ClutterAnimator defines a custom "properties" property
|
||||||
|
* which allows describing the key frames for objects.</para>
|
||||||
|
* <para>The "properties" property has the following syntax:</para>
|
||||||
|
* <informalexample>
|
||||||
|
* <programlisting>
|
||||||
|
* {
|
||||||
|
* "properties" : [
|
||||||
|
* {
|
||||||
|
* "object" : <id of an object>,
|
||||||
|
* "name" : <name of the property>,
|
||||||
|
* "ease-in" : <boolean>,
|
||||||
|
* "interpolation" : <#ClutterInterpolation value>,
|
||||||
|
* "keys" : [
|
||||||
|
* [ <progress>, <easing mode>, <final value> ]
|
||||||
|
* ]
|
||||||
|
* ]
|
||||||
|
* }
|
||||||
|
* </programlisting>
|
||||||
|
* </informalexample>
|
||||||
|
* <example id="ClutterAnimator-script-example">
|
||||||
|
* <title>ClutterAnimator definition<title>
|
||||||
|
* <para>The following JSON fragment defines a #ClutterAnimator
|
||||||
|
* with the duration of 1 second and operating on the x and y
|
||||||
|
* properties of a #ClutterActor named "rect-01", with two frames
|
||||||
|
* for each property. The first frame will linearly move the actor
|
||||||
|
* from its current position to the 100, 100 position in 20 percent
|
||||||
|
* of the duration of the animation; the second will using a cubic
|
||||||
|
* easing to move the actor to the 200, 200 coordinates.</para>
|
||||||
|
* <programlisting>
|
||||||
|
* {
|
||||||
|
* "type" : "ClutterAnimator",
|
||||||
|
* "duration" : 1000,
|
||||||
|
* "properties" : [
|
||||||
|
* {
|
||||||
|
* "object" : "rect-01",
|
||||||
|
* "name" : "x",
|
||||||
|
* "ease-in" : true,
|
||||||
|
* "keys" : [
|
||||||
|
* [ 0.2, "linear", 100.0 ],
|
||||||
|
* [ 1.0, "easeOutCubic", 200.0 ]
|
||||||
|
* ]
|
||||||
|
* },
|
||||||
|
* {
|
||||||
|
* "object" : "rect-01",
|
||||||
|
* "name" : "y",
|
||||||
|
* "ease-in" : true,
|
||||||
|
* "keys" : [
|
||||||
|
* [ 0.2, "linear", 100.0 ],
|
||||||
|
* [ 1.0, "easeOutCubic", 200.0 ]
|
||||||
|
* ]
|
||||||
|
* }
|
||||||
|
* ]
|
||||||
|
* }
|
||||||
|
* </programlisting>
|
||||||
|
* </example>
|
||||||
|
* </refsect2>
|
||||||
|
*
|
||||||
* #ClutterAnimator is available since Clutter 1.2
|
* #ClutterAnimator is available since Clutter 1.2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user