From cecbf060661a3cf47e876f8dec0207e0f082c3d4 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Mon, 25 Aug 2014 22:24:47 +0200 Subject: Added icons : - restart level Added transitions --- qml/pages/Point.qml | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) (limited to 'qml/pages/Point.qml') 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 -- cgit v1.2.3