summaryrefslogtreecommitdiffstats
path: root/demos/declarative/samegame/content/SpinBlock.qml
diff options
context:
space:
mode:
Diffstat (limited to 'demos/declarative/samegame/content/SpinBlock.qml')
-rw-r--r--demos/declarative/samegame/content/SpinBlock.qml9
1 files changed, 9 insertions, 0 deletions
diff --git a/demos/declarative/samegame/content/SpinBlock.qml b/demos/declarative/samegame/content/SpinBlock.qml
index 1e92d9e..4c8f123 100644
--- a/demos/declarative/samegame/content/SpinBlock.qml
+++ b/demos/declarative/samegame/content/SpinBlock.qml
@@ -18,6 +18,9 @@ Item { id:block
"pics/gnome/greenStone.gif";
}
paused: !selected
+ paused: Behavior { to: true; from: false;
+ NumberAnimation { properties:"currentFrame"; to:0; duration: 200}
+ }
}
opacity: 0
y: targetY
@@ -25,6 +28,12 @@ Item { id:block
y: Behavior { NumberAnimation { properties:"y"; duration: 200 } }
x: Behavior { NumberAnimation { properties:"x"; duration: 200 } }
opacity: Behavior { NumberAnimation { properties:"opacity"; duration: 200 } }
+ MouseRegion {
+ id: gameMR; anchors.fill: parent
+ onClicked: handleClick(Math.floor(parent.x/width), Math.floor(parent.y/height));
+ onEntered: handleHover(Math.floor(parent.x/width), Math.floor(parent.y/height));
+ onExited: handleHover(Math.floor(parent.x/width), Math.floor(parent.y/height));
+ }
states: [