[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [gcompris] src/activities: hexagon, fix colorize effect
From:       Bruno Coudoin <bruno.coudoin () gcompris ! net>
Date:       2015-11-30 20:08:44
Message-ID: E1a3Uke-0003JI-R6 () scm ! kde ! org
[Download RAW message or body]

Git commit 006d11ed9bb50590d9e373a9477f6d3d80d421c7 by Bruno Coudoin.
Committed on 30/11/2015 at 20:07.
Pushed by bcoudoin into branch 'master'.

hexagon, fix colorize effect

It is no allowed to use 'parent' in a ColorOverlay. Improved the
strawberry effect a little bit while I was on it.

M  +0    -10   src/activities/click_on_letter/Carriage.qml
M  +1    -0    src/activities/hexagon/Hexagon.qml
M  +14   -15   src/activities/hexagon/HexagonItem.qml

http://commits.kde.org/gcompris/006d11ed9bb50590d9e373a9477f6d3d80d421c7

diff --git a/src/activities/click_on_letter/Carriage.qml b/src/activities/click_on_letter/Carriage.qml
index 5bf912a..4e5a18c 100644
--- a/src/activities/click_on_letter/Carriage.qml
+++ b/src/activities/click_on_letter/Carriage.qml
@@ -132,16 +132,6 @@ Image {
             duration: 50 }
     }
 
-    Colorize {
-        id: color
-        anchors.fill: parent
-        source: parent
-        hue: 0.0
-        saturation: 1
-        opacity: 0
-    }
-
-
     SequentialAnimation {
         id: failureAnimation
         NumberAnimation {
diff --git a/src/activities/hexagon/Hexagon.qml b/src/activities/hexagon/Hexagon.qml
index fe5473b..fd58887 100644
--- a/src/activities/hexagon/Hexagon.qml
+++ b/src/activities/hexagon/Hexagon.qml
@@ -112,6 +112,7 @@ ActivityBase {
 
         Bonus {
             id: bonus
+            interval: 3000
             Component.onCompleted: win.connect(Activity.nextLevel)
         }
     }
diff --git a/src/activities/hexagon/HexagonItem.qml b/src/activities/hexagon/HexagonItem.qml
index 1c60d79..407afaf 100644
--- a/src/activities/hexagon/HexagonItem.qml
+++ b/src/activities/hexagon/HexagonItem.qml
@@ -47,16 +47,15 @@ Item {
     Image {
         id: strawberry
         anchors.fill: parent
+        opacity: 0
+        onSourceChanged: opacity = 1
+        Behavior on opacity { PropertyAnimation { duration: 2000; easing.type: Easing.OutQuad } }
     }
 
-
     Image {
       id: border
       anchors.fill: parent
       source: Activity.url + "hexagon_border.svg"
-
-      onOpacityChanged: if(opacity == 0) Activity.strawberryFound()
-
       Behavior on opacity { PropertyAnimation { duration: 500 } }
     }
 
@@ -64,17 +63,16 @@ Item {
       id: canvas
       anchors.fill: parent
       source: Activity.url + "hexagon.svg"
+      visible: false
+    }
 
-      onOpacityChanged: if(opacity == 0) Activity.strawberryFound()
-      opacity: 0.65
-
-      Behavior on opacity { PropertyAnimation { duration: 500 } }
-
-      ColorOverlay {
-          id: colorOverlay
-          anchors.fill: parent
-          source: canvas
-      }
+    ColorOverlay {
+        id: colorOverlay
+        anchors.fill: canvas
+        source: canvas
+        onOpacityChanged: if(opacity == 0) Activity.strawberryFound()
+        opacity: 0.65
+        Behavior on opacity { PropertyAnimation { duration: 500 } }
     }
 
     // Create a particle only for the strawberry
@@ -97,7 +95,8 @@ Item {
     property bool isTouched: false
     function touched() {
         if(hasStrawberry && !isTouched) {
-            canvas.opacity = 0
+            colorOverlay.opacity = 0
+            border.opacity = 0
             isTouched = true
             strawberry.source = Activity.url + "strawberry.svg"
             audioEffects.play("qrc:/gcompris/src/core/resource/sounds/win.wav")
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic