diff options
Diffstat (limited to 'examples/declarative/tic-tac-toe/tic-tac-toe.qml')
-rw-r--r-- | examples/declarative/tic-tac-toe/tic-tac-toe.qml | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/examples/declarative/tic-tac-toe/tic-tac-toe.qml b/examples/declarative/tic-tac-toe/tic-tac-toe.qml index ca66a46..dd13052 100644 --- a/examples/declarative/tic-tac-toe/tic-tac-toe.qml +++ b/examples/declarative/tic-tac-toe/tic-tac-toe.qml @@ -4,23 +4,23 @@ import "content/tic-tac-toe.js" as Logic Item { id: game - property bool show: false; + + property bool show: false + property real difficulty: 1.0 //chance it will actually think + width: 440 height: 480 anchors.fill: parent - property real difficulty: 1.0; //chance it will actually think Image { id: boardimage - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter + anchors { verticalCenter: parent.verticalCenter; horizontalCenter: parent.horizontalCenter } source: "content/pics/board.png" } Grid { id: board anchors.fill: boardimage - columns: 3 Repeater { @@ -46,33 +46,32 @@ Item { Row { spacing: 4 - anchors.top: board.bottom - anchors.horizontalCenter: board.horizontalCenter + anchors { top: board.bottom; horizontalCenter: board.horizontalCenter } + Button { text: "Hard" - onClicked: game.difficulty=1.0; + onClicked: game.difficulty = 1.0; down: game.difficulty == 1.0 } Button { text: "Moderate" - onClicked: game.difficulty=0.8; + onClicked: game.difficulty = 0.8; down: game.difficulty == 0.8 } Button { text: "Easy" - onClicked: game.difficulty=0.2; + onClicked: game.difficulty = 0.2; down: game.difficulty == 0.2 } } Text { id: msg - opacity: 0 + anchors.centerIn: parent + opacity: 0 color: "blue" - styleColor: "white" - style: Text.Outline - font.pixelSize: 50 - font.bold: true + style: Text.Outline; styleColor: "white" + font.pixelSize: 50; font.bold: true } } |