Commit 006d11ed authored by Bruno Coudoin's avatar Bruno Coudoin
Browse files

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.
parent 45a82d5a
......@@ -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 {
......
......@@ -112,6 +112,7 @@ ActivityBase {
Bonus {
id: bonus
interval: 3000
Component.onCompleted: win.connect(Activity.nextLevel)
}
}
......
......@@ -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")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment