ChickenOutbreak2 Demo
import QtQuick 2.0
Item {
width: coinText.width+coinImage.width+(displayCustomCoins ? 5 : 6.75)
height: 20
property bool displayBonusCoins: false
property int bonusCoins: 0
property bool displayCustomCoins: false
property int customCoins: 0
property int pixelSize: 20
property string color: "#f5b68a"
Image {
id: coinImage
source: displayCustomCoins ? "../assets/saveit_single.png" : "../assets/coin_single.png"
width: displayCustomCoins ? 20 : 15.25
height: 20
anchors.verticalCenter: parent.verticalCenter
}
Text {
id: coinText
color: parent.color
font.family: fontHUD.name
font.pixelSize: parent.pixelSize
text: getText()
x: displayCustomCoins ? 25 : 22
anchors.verticalCenter: parent.verticalCenter
}
function getText() {
if(displayBonusCoins)
return bonusCoins + qsTr(" earned")
else if(displayCustomCoins)
return customCoins+""