-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathEndPanel.qml
40 lines (32 loc) · 1007 Bytes
/
EndPanel.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
import QtQuick 2.0
Image {
id: containerImg
source: victory === true ? "qrc:///images/victory.png" : "qrc:///images/failed.png"
property int steps: 0
property bool victory: true
signal restart()
FontLoader { id: localFont; source: "qrc:///ttf/MFDingDing.otf" }
Text {
id: text
x: containerImg.width / 20
y: containerImg.height / 2
font { family: localFont.name; pointSize: 30 }
color: "orangered"
text: victory === true ? "你真棒! 一共用了 " + steps + " 步!" : "你没有抓住神经猫 ~(^(OO)^)~"
}
Image {
id: btn
anchors.bottom: containerImg.bottom
anchors.right: containerImg.right
anchors.margins: 40
width: containerImg.width / 2
height: containerImg.height / 4
source: "qrc:///images/replay.png"
MouseArea {
anchors.fill: btn
onClicked: {
containerImg.restart();
}
}
}
}