diff options
author | mae <qt-info@nokia.com> | 2010-07-08 15:49:23 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2010-07-19 10:17:43 (GMT) |
commit | 8ec06dbfdcbb43b6b02523247a6e88c61b4e0011 (patch) | |
tree | d8e5de67cb54223ce6c7ae6ed3a3e9a4586be6ac /demos | |
parent | 466a878c5df629759496ac68be1b4ce0527a78f0 (diff) | |
download | Qt-8ec06dbfdcbb43b6b02523247a6e88c61b4e0011.zip Qt-8ec06dbfdcbb43b6b02523247a6e88c61b4e0011.tar.gz Qt-8ec06dbfdcbb43b6b02523247a6e88c61b4e0011.tar.bz2 |
Follow -> Behavior
Replace the usages of Follows with Behaviors, update docs.
(cherry picked from commit b22a5e13003ff9f23b075284a1a1e0a6b0e46250)
Diffstat (limited to 'demos')
-rw-r--r-- | demos/declarative/samegame/SamegameCore/BoomBlock.qml | 11 | ||||
-rwxr-xr-x | demos/declarative/samegame/SamegameCore/samegame.js | 7 |
2 files changed, 10 insertions, 8 deletions
diff --git a/demos/declarative/samegame/SamegameCore/BoomBlock.qml b/demos/declarative/samegame/SamegameCore/BoomBlock.qml index 3f43579..43050af 100644 --- a/demos/declarative/samegame/SamegameCore/BoomBlock.qml +++ b/demos/declarative/samegame/SamegameCore/BoomBlock.qml @@ -47,11 +47,14 @@ Item { property bool dying: false property bool spawned: false property int type: 0 - property int targetX: 0 - property int targetY: 0 - SpringFollow on x { enabled: spawned; to: targetX; spring: 2; damping: 0.2 } - SpringFollow on y { to: targetY; spring: 2; damping: 0.2 } + Behavior on x { + enabled: spawned; + SpringAnimation{ spring: 2; damping: 0.2 } + } + Behavior on y { + SpringAnimation{ spring: 2; damping: 0.2 } + } Image { id: img diff --git a/demos/declarative/samegame/SamegameCore/samegame.js b/demos/declarative/samegame/SamegameCore/samegame.js index 5c008a2..6e1b24d 100755 --- a/demos/declarative/samegame/SamegameCore/samegame.js +++ b/demos/declarative/samegame/SamegameCore/samegame.js @@ -110,7 +110,7 @@ function shuffleDown() }else{ if(fallDist > 0){ var obj = board[index(column,row)]; - obj.targetY += fallDist * gameCanvas.blockSize; + obj.y += fallDist * gameCanvas.blockSize; board[index(column,row+fallDist)] = obj; board[index(column,row)] = null; } @@ -128,7 +128,7 @@ function shuffleDown() obj = board[index(column,row)]; if(obj == null) continue; - obj.targetX -= fallDist * gameCanvas.blockSize; + obj.x -= fallDist * gameCanvas.blockSize; board[index(column-fallDist,row)] = obj; board[index(column,row)] = null; } @@ -184,8 +184,7 @@ function createBlock(column,row){ } dynamicObject.type = Math.floor(Math.random() * 3); dynamicObject.x = column*gameCanvas.blockSize; - dynamicObject.targetX = column*gameCanvas.blockSize; - dynamicObject.targetY = row*gameCanvas.blockSize; + dynamicObject.y = row*gameCanvas.blockSize; dynamicObject.width = gameCanvas.blockSize; dynamicObject.height = gameCanvas.blockSize; dynamicObject.spawned = true; |