summaryrefslogtreecommitdiffstats
path: root/demos/declarative
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2009-07-29 06:53:36 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2009-07-29 06:53:36 (GMT)
commita9b507ccd9392269f1df2522306a9ece3628c6c7 (patch)
tree2746798589151551d9c99a4ce290409fbf63cb9f /demos/declarative
parent20d9edfa3b7a8a648cfdb59a0e71525912f0a0a8 (diff)
parent26cd689a2356973020b7f4c9d86b2ee71b3ef8fe (diff)
downloadQt-a9b507ccd9392269f1df2522306a9ece3628c6c7.zip
Qt-a9b507ccd9392269f1df2522306a9ece3628c6c7.tar.gz
Qt-a9b507ccd9392269f1df2522306a9ece3628c6c7.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'demos/declarative')
-rw-r--r--demos/declarative/samegame/SameGame.qml13
-rwxr-xr-xdemos/declarative/samegame/content/samegame.js4
2 files changed, 7 insertions, 10 deletions
diff --git a/demos/declarative/samegame/SameGame.qml b/demos/declarative/samegame/SameGame.qml
index 3b80692..9e1b1ae 100644
--- a/demos/declarative/samegame/SameGame.qml
+++ b/demos/declarative/samegame/SameGame.qml
@@ -9,7 +9,9 @@ Rect {
Rect {
id: gameCanvas
property int score: 0
- z:20; y:20; width:400; height:600; color: "white"; pen.width: 1
+ z:20; y:20; color: "white"; pen.width: 1
+ width:parent.width - tileSize - (parent.width % tileSize);
+ height:parent.height - tileSize - (parent.height % tileSize);
anchors.horizontalCenter: parent.horizontalCenter
Image { id:background;
source: "content/pics/background.png"
@@ -29,13 +31,4 @@ Rect {
text: "Score: " + gameCanvas.score; width:100; font.size:14
anchors.top: gameCanvas.bottom; anchors.topMargin: 4; anchors.right: gameCanvas.right;
}
- Text {
- text: "Just over 300 lines of QML/JS code!"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: parent.bottom; anchors.bottomMargin: 16;
- opacity: SequentialAnimation{ running: true; repeat: true;
- NumberAnimation { from: 0; to: 1; duration: 1000; easing: "easeInQuad" }
- NumberAnimation { from: 1; to: 0; duration: 1000; easing: "easeInQuad" }
- }
- }
}
diff --git a/demos/declarative/samegame/content/samegame.js b/demos/declarative/samegame/content/samegame.js
index a7dd82b..f04fb4c 100755
--- a/demos/declarative/samegame/content/samegame.js
+++ b/demos/declarative/samegame/content/samegame.js
@@ -21,6 +21,10 @@ function initBoard()
board[i].destroy();
}
+ maxX = Math.floor(gameCanvas.width/tileSize);
+ maxY = Math.floor(gameCanvas.height/tileSize);
+ maxIndex = maxY*maxX;
+
//Initialize Board
board = new Array(maxIndex);
gameCanvas.score = 0;