Add support for face down cards
This commit is contained in:
parent
3a8b22e07a
commit
9762d7d566
1
Main.qml
1
Main.qml
|
@ -20,5 +20,6 @@ ApplicationWindow {
|
||||||
PlayingCard {
|
PlayingCard {
|
||||||
color: "clubs"
|
color: "clubs"
|
||||||
value: "ace"
|
value: "ace"
|
||||||
|
isFaceDown: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,11 +10,15 @@ Item {
|
||||||
// anyways, typing these as simple strings is the easiest way to do this.
|
// anyways, typing these as simple strings is the easiest way to do this.
|
||||||
required property string color
|
required property string color
|
||||||
required property string value
|
required property string value
|
||||||
|
property string backStyle: "red"
|
||||||
|
property bool isFaceDown: false
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: cardImage
|
id: cardImage
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
source: "qrc:/img/playing_cards/fronts/" + playingCard.color + "_" + playingCard.value + ".svg"
|
source: playingCard.isFaceDown
|
||||||
|
? "qrc:/img/playing_cards/backs/" + playingCard.backStyle + ".svg"
|
||||||
|
: "qrc:/img/playing_cards/fronts/" + playingCard.color + "_" + playingCard.value + ".svg"
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue