diff options
author | mae <qt-info@nokia.com> | 2010-07-08 17:49:23 +0200 |
---|---|---|
committer | mae <qt-info@nokia.com> | 2010-07-08 18:34:25 +0200 |
commit | b22a5e13003ff9f23b075284a1a1e0a6b0e46250 (patch) | |
tree | 178f70df43aa34851efd82b1286a472c3f1fd500 /doc/src/declarative/advtutorial.qdoc | |
parent | d5d16b3d3304774df11f40df0206d90ed5f840de (diff) | |
download | qt4-tools-b22a5e13003ff9f23b075284a1a1e0a6b0e46250.tar.gz |
Follow -> Behavior
Replace the usages of Follows with Behaviors, update docs.
Diffstat (limited to 'doc/src/declarative/advtutorial.qdoc')
-rw-r--r-- | doc/src/declarative/advtutorial.qdoc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc index 2c3610c44c..afedb44d83 100644 --- a/doc/src/declarative/advtutorial.qdoc +++ b/doc/src/declarative/advtutorial.qdoc @@ -306,18 +306,17 @@ In anticipation of the new block animations, \c Block.qml file is now renamed to \section3 Animating block movement First we will animate the blocks so that they move in a fluid manner. QML has a number of methods for adding fluid -movement, and in this case we're going to use the \l SpringFollow element to add an animation with a spring-like -movement. In \c BoomBlock.qml, we apply a \l SpringFollow -to the \c x and \c y properties so that the block will follow and animate its movement towards the -position specified by the new \c targetX and \c targetY properties (whose values will be set by \c samegame.js). -Here is the code added to \c BoomBlock.qml: +movement, and in this case we're going to use the \l Behavior element to add a \l SpringAnimation. +In \c BoomBlock.qml, we apply a \l SpringAnimation behavior to the \c x and \c y properties so that the +block will follow and animate its movement in a spring-like fashion towards the specified position (whose +values will be set by \c samegame.js).Here is the code added to \c BoomBlock.qml: \snippet declarative/tutorials/samegame/samegame4/content/BoomBlock.qml 1 The \c spring and \c damping values can be changed to modify the spring-like effect of the animation. The \c {enabled: spawned} setting refers to the \c spawned value that is set from \c createBlock() in \c samegame.js. -This ensures the \l SpringFollow on the \c x is only enabled after \c createBlock() has set the block to +This ensures the \l SpringAnimation on the \c x is only enabled after \c createBlock() has set the block to the correct position. Otherwise, the blocks will slide out of the corner (0,0) when a game begins, instead of falling from the top in rows. (Try commenting out \c {enabled: spawned} and see for yourself.) |