summaryrefslogtreecommitdiff
path: root/qml/pages/Point.qml
diff options
context:
space:
mode:
Diffstat (limited to 'qml/pages/Point.qml')
-rw-r--r--qml/pages/Point.qml44
1 files changed, 41 insertions, 3 deletions
diff --git a/qml/pages/Point.qml b/qml/pages/Point.qml
index f610461..e889336 100644
--- a/qml/pages/Point.qml
+++ b/qml/pages/Point.qml
@@ -1,19 +1,57 @@
import QtQuick 2.0
-import "../actions.js" as Actions
-
Item {
property string type: "";
+ property alias piece_scale: piece.scale;
function getImageForType() {
if ("" === type) {
return ""
}
-
return "../content/gfx/" + type + ".png"
}
+ function init(initType) {
+ type = initType;
+ piece.opacity = 1;
+ piece.scale = 1;
+
+ }
+
+ states: [
+ State {
+ name: "shown"
+ PropertyChanges { target: piece; opacity:1 }
+ }, State {
+ name: "remove"
+ onCompleted: type = "";
+ }
+ ]
+
+ transitions: [
+ Transition {
+ to: "remove"
+ NumberAnimation {
+ targets: piece;
+ property: "opacity";
+ from: 1;
+ to: 0
+ duration: 500;
+ }
+ },
+ Transition {
+ to: "shown"
+ PropertyAnimation {
+ target: piece;
+ property: "scale";
+ from: 0;
+ to: 1
+ easing.type: Easing.OutBack
+ }
+ }
+ ]
+
MouseArea {
id: interactiveArea