-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBrick.qml
62 lines (50 loc) · 1.2 KB
/
Brick.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import QtQuick 1.0
Image {
id: root
property int vida: 1
state: "NORMAL"
source: "pics/green_brick.png"
fillMode: Image.PreserveAspectFit
states: [
State {
name: "EXPLODE"
when: root.vida < 1
PropertyChanges {
target: root;
opacity: 0
}
},
State {
name: "One";
when: root.vida == 1;
PropertyChanges {
target: root;
source: "pics/green_brick.png"
}
},
State {
name: "Two";
when: root.vida == 2;
PropertyChanges {
target: root;
source: "pics/yellow_brick.png"
}
},
State {
name: "Three"
when: root.vida = 3;
PropertyChanges {
target: root;
source: "pics/red_brick.png"
}
}
]
transitions: [
Transition {
from: "*"
to: "EXPLODE"
NumberAnimation { target: root; property: "opacity"; duration: 1000 }
}
]
Component.onCompleted: { status: "NORMAL" }
}