57 lines
1 KiB
QML
57 lines
1 KiB
QML
import QtQuick 2.9
|
|
import QtQuick.Window 2.2
|
|
import QtQuick.Controls 2.4
|
|
|
|
Window {
|
|
visible: true
|
|
width: 640
|
|
height: 480
|
|
title: "QcookieClicker"
|
|
|
|
Page {
|
|
id: app
|
|
|
|
property int level: 0
|
|
|
|
anchors.fill: parent
|
|
|
|
Label {
|
|
id: levelLa
|
|
|
|
anchors {
|
|
top: parent.top
|
|
horizontalCenter: parent.horizontalCenter
|
|
topMargin: 20
|
|
}
|
|
|
|
font.pixelSize: 30
|
|
|
|
text: app.level
|
|
}
|
|
|
|
Button {
|
|
id: cookieBt
|
|
|
|
anchors.centerIn: parent
|
|
|
|
height: parent.height * 0.3
|
|
width: height
|
|
|
|
scale: pressed ? 0.8:1
|
|
|
|
background: Image {
|
|
source: "qrc:/icons/cookie.png"
|
|
}
|
|
|
|
onClicked: {
|
|
app.level = app.level + 1
|
|
}
|
|
|
|
Behavior on scale {
|
|
NumberAnimation {
|
|
duration: 100
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|