summaryrefslogtreecommitdiffstats
path: root/examples/declarative/tutorials/samegame/samegame4/samegame.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/tutorials/samegame/samegame4/samegame.qml')
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/samegame.qml18
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/declarative/tutorials/samegame/samegame4/samegame.qml b/examples/declarative/tutorials/samegame/samegame4/samegame.qml
index 090496d..5d5c81f 100644
--- a/examples/declarative/tutorials/samegame/samegame4/samegame.qml
+++ b/examples/declarative/tutorials/samegame/samegame4/samegame.qml
@@ -1,4 +1,4 @@
-import Qt 4.6
+import Qt 4.7
import "content"
import "content/samegame.js" as SameGame
@@ -20,11 +20,11 @@ Rectangle {
Item {
id: gameCanvas
property int score: 0
- property int tileSize: 40
+ property int blockSize: 40
z: 20; anchors.centerIn: parent
- width: parent.width - (parent.width % getTileSize());
- height: parent.height - (parent.height % getTileSize());
+ width: parent.width - (parent.width % blockSize);
+ height: parent.height - (parent.height % blockSize);
MouseArea {
anchors.fill: parent; onClicked: SameGame.handleClick(mouse.x,mouse.y);
@@ -36,7 +36,7 @@ Rectangle {
//![0]
Dialog {
- id: scoreName; anchors.centerIn: parent; z: 22;
+ id: nameInputDialog; anchors.centerIn: parent; z: 22;
Text {
id: spacer
opacity: 0
@@ -45,9 +45,9 @@ Rectangle {
TextInput {
id: editor
onAccepted: {
- if(scoreName.opacity==1&&editor.text!="")
- saveHighScore(editor.text);
- scoreName.forceClose();
+ if(nameInputDialog.opacity==1&&editor.text!="")
+ SameGame.saveHighScore(editor.text);
+ nameInputDialog.forceClose();
}
anchors.verticalCenter: parent.verticalCenter
width: 72; focus: true
@@ -63,7 +63,7 @@ Rectangle {
anchors.bottom: screen.bottom
Button {
- id: btnA; text: "New Game"; onClicked: {SameGame.initBoard();}
+ text: "New Game"; onClicked: SameGame.startNewGame();
anchors.left: parent.left; anchors.leftMargin: 3
anchors.verticalCenter: parent.verticalCenter
}