-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlayerStats.qml
47 lines (41 loc) · 1.05 KB
/
PlayerStats.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
import QtQuick 2.9
Rectangle {
id: playerRect
property string playerColor
property bool currentPlayer: false
property alias playerName: name.text
property int squareCount: 0
width: 100
height: 50
color: playerColor
Column {
anchors.centerIn: parent
Text {
id: name
font.bold: true
color: playerRect.playerColor == "black" ? "white" : "black"
}
Text {
id: count
text: playerRect.squareCount
color: name.color
}
}
Rectangle {
gradient: Gradient {
GradientStop { position: 0.0; color: Qt.rgba(0, 1, 0, 0) }
GradientStop { position: 1.0; color: "green" }
}
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
height: parent.height/3
smooth: true
opacity: currentPlayer ? 1 : 0
Behavior on opacity {
PropertyAnimation {
duration: 150
}
}
}
}