From 4f77d4f1bebba1627700037bdfce4e74ad84cce8 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Mon, 1 Mar 2010 22:51:24 +1000 Subject: Make SameGame tutorials share images It's a bit of a waste to have four copies of all of the images. And as an advanced tutorial throwing in a minor complication like this is probably beneficial. Additionally, the background has been replaced by a smaller JPEG version. --- doc/src/declarative/advtutorial.qdoc | 5 +++++ .../declarative/tutorials/samegame/samegame1/Block.qml | 2 +- .../tutorials/samegame/samegame1/pics/background.png | Bin 313930 -> 0 bytes .../tutorials/samegame/samegame1/pics/redStone.png | Bin 2902 -> 0 bytes .../tutorials/samegame/samegame1/samegame.qml | 2 +- .../declarative/tutorials/samegame/samegame2/Block.qml | 2 +- .../tutorials/samegame/samegame2/pics/background.png | Bin 313930 -> 0 bytes .../tutorials/samegame/samegame2/pics/redStone.png | Bin 2902 -> 0 bytes .../tutorials/samegame/samegame2/samegame.qml | 2 +- .../declarative/tutorials/samegame/samegame3/Block.qml | 6 +++--- .../tutorials/samegame/samegame3/pics/background.png | Bin 313930 -> 0 bytes .../tutorials/samegame/samegame3/pics/blueStone.png | Bin 3054 -> 0 bytes .../tutorials/samegame/samegame3/pics/greenStone.png | Bin 2932 -> 0 bytes .../tutorials/samegame/samegame3/pics/redStone.png | Bin 2902 -> 0 bytes .../tutorials/samegame/samegame3/samegame.qml | 2 +- .../tutorials/samegame/samegame4/content/BoomBlock.qml | 12 ++++++------ .../samegame/samegame4/content/pics/background.png | Bin 313930 -> 0 bytes .../samegame/samegame4/content/pics/blueStar.png | Bin 278 -> 0 bytes .../samegame/samegame4/content/pics/blueStone.png | Bin 3054 -> 0 bytes .../samegame/samegame4/content/pics/greenStar.png | Bin 273 -> 0 bytes .../samegame/samegame4/content/pics/greenStone.png | Bin 2932 -> 0 bytes .../samegame/samegame4/content/pics/redStar.png | Bin 274 -> 0 bytes .../samegame/samegame4/content/pics/redStone.png | Bin 2902 -> 0 bytes .../tutorials/samegame/samegame4/content/pics/star.png | Bin 262 -> 0 bytes .../samegame/samegame4/content/pics/yellowStone.png | Bin 3056 -> 0 bytes .../tutorials/samegame/samegame4/samegame.qml | 2 +- .../tutorials/samegame/shared/pics/background.jpg | Bin 0 -> 36473 bytes .../tutorials/samegame/shared/pics/blueStar.png | Bin 0 -> 278 bytes .../tutorials/samegame/shared/pics/blueStone.png | Bin 0 -> 3054 bytes .../tutorials/samegame/shared/pics/greenStar.png | Bin 0 -> 273 bytes .../tutorials/samegame/shared/pics/greenStone.png | Bin 0 -> 2932 bytes .../tutorials/samegame/shared/pics/redStar.png | Bin 0 -> 274 bytes .../tutorials/samegame/shared/pics/redStone.png | Bin 0 -> 2902 bytes .../tutorials/samegame/shared/pics/star.png | Bin 0 -> 262 bytes .../tutorials/samegame/shared/pics/yellowStone.png | Bin 0 -> 3056 bytes 35 files changed, 20 insertions(+), 15 deletions(-) delete mode 100644 examples/declarative/tutorials/samegame/samegame1/pics/background.png delete mode 100644 examples/declarative/tutorials/samegame/samegame1/pics/redStone.png delete mode 100644 examples/declarative/tutorials/samegame/samegame2/pics/background.png delete mode 100644 examples/declarative/tutorials/samegame/samegame2/pics/redStone.png delete mode 100644 examples/declarative/tutorials/samegame/samegame3/pics/background.png delete mode 100644 examples/declarative/tutorials/samegame/samegame3/pics/blueStone.png delete mode 100644 examples/declarative/tutorials/samegame/samegame3/pics/greenStone.png delete mode 100644 examples/declarative/tutorials/samegame/samegame3/pics/redStone.png delete mode 100644 examples/declarative/tutorials/samegame/samegame4/content/pics/background.png delete mode 100644 examples/declarative/tutorials/samegame/samegame4/content/pics/blueStar.png delete mode 100644 examples/declarative/tutorials/samegame/samegame4/content/pics/blueStone.png delete mode 100644 examples/declarative/tutorials/samegame/samegame4/content/pics/greenStar.png delete mode 100644 examples/declarative/tutorials/samegame/samegame4/content/pics/greenStone.png delete mode 100644 examples/declarative/tutorials/samegame/samegame4/content/pics/redStar.png delete mode 100644 examples/declarative/tutorials/samegame/samegame4/content/pics/redStone.png delete mode 100644 examples/declarative/tutorials/samegame/samegame4/content/pics/star.png delete mode 100644 examples/declarative/tutorials/samegame/samegame4/content/pics/yellowStone.png create mode 100644 examples/declarative/tutorials/samegame/shared/pics/background.jpg create mode 100644 examples/declarative/tutorials/samegame/shared/pics/blueStar.png create mode 100644 examples/declarative/tutorials/samegame/shared/pics/blueStone.png create mode 100644 examples/declarative/tutorials/samegame/shared/pics/greenStar.png create mode 100644 examples/declarative/tutorials/samegame/shared/pics/greenStone.png create mode 100644 examples/declarative/tutorials/samegame/shared/pics/redStar.png create mode 100644 examples/declarative/tutorials/samegame/shared/pics/redStone.png create mode 100644 examples/declarative/tutorials/samegame/shared/pics/star.png create mode 100644 examples/declarative/tutorials/samegame/shared/pics/yellowStone.png diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc index b7d964c..e420e6d 100644 --- a/doc/src/declarative/advtutorial.qdoc +++ b/doc/src/declarative/advtutorial.qdoc @@ -106,6 +106,11 @@ more than just an image. Note that we've set the image to be the size of the ite This will be used later, when we dynamically create and size the block items the image will be scaled automatically to the correct size. +Note that because there are several stages to this tutorial they share images. This is done by having a shared resources +folder containing the images, and all stages of the tutorial refer to the same shared folder. This is the reason for the +'../shared/pics' part of the image source. The image source can be any relative or absolute path, and it is relative to the +location of the file the Image element is in, with ../ meaning to go up one level. + You should be familiar with all that goes on in these files so far. This is a very basic start and doesn't move at all - next we will populate the game canvas with some blocks. diff --git a/examples/declarative/tutorials/samegame/samegame1/Block.qml b/examples/declarative/tutorials/samegame/samegame1/Block.qml index b76e61a..f133b17 100644 --- a/examples/declarative/tutorials/samegame/samegame1/Block.qml +++ b/examples/declarative/tutorials/samegame/samegame1/Block.qml @@ -5,7 +5,7 @@ Item { id:block Image { id: img - source: "pics/redStone.png"; + source: "../shared/pics/redStone.png"; anchors.fill: parent } } diff --git a/examples/declarative/tutorials/samegame/samegame1/pics/background.png b/examples/declarative/tutorials/samegame/samegame1/pics/background.png deleted file mode 100644 index 3734a27..0000000 Binary files a/examples/declarative/tutorials/samegame/samegame1/pics/background.png and /dev/null differ diff --git a/examples/declarative/tutorials/samegame/samegame1/pics/redStone.png b/examples/declarative/tutorials/samegame/samegame1/pics/redStone.png deleted file mode 100644 index 36b09a2..0000000 Binary files a/examples/declarative/tutorials/samegame/samegame1/pics/redStone.png and /dev/null differ diff --git a/examples/declarative/tutorials/samegame/samegame1/samegame.qml b/examples/declarative/tutorials/samegame/samegame1/samegame.qml index c2d3939..5ed30c9 100644 --- a/examples/declarative/tutorials/samegame/samegame1/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame1/samegame.qml @@ -12,7 +12,7 @@ Rectangle { Image { id: background - anchors.fill: parent; source: "pics/background.png" + anchors.fill: parent; source: "../shared/pics/background.jpg" fillMode: Image.PreserveAspectCrop } } diff --git a/examples/declarative/tutorials/samegame/samegame2/Block.qml b/examples/declarative/tutorials/samegame/samegame2/Block.qml index 228ac4e..e4b3354 100644 --- a/examples/declarative/tutorials/samegame/samegame2/Block.qml +++ b/examples/declarative/tutorials/samegame/samegame2/Block.qml @@ -4,7 +4,7 @@ Item { id:block Image { id: img - source: "pics/redStone.png"; + source: "../shared/pics/redStone.png"; anchors.fill: parent } } diff --git a/examples/declarative/tutorials/samegame/samegame2/pics/background.png b/examples/declarative/tutorials/samegame/samegame2/pics/background.png deleted file mode 100644 index 3734a27..0000000 Binary files a/examples/declarative/tutorials/samegame/samegame2/pics/background.png and /dev/null differ diff --git a/examples/declarative/tutorials/samegame/samegame2/pics/redStone.png b/examples/declarative/tutorials/samegame/samegame2/pics/redStone.png deleted file mode 100644 index 36b09a2..0000000 Binary files a/examples/declarative/tutorials/samegame/samegame2/pics/redStone.png and /dev/null differ diff --git a/examples/declarative/tutorials/samegame/samegame2/samegame.qml b/examples/declarative/tutorials/samegame/samegame2/samegame.qml index 8d837da..7e0bc0c 100644 --- a/examples/declarative/tutorials/samegame/samegame2/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame2/samegame.qml @@ -14,7 +14,7 @@ Rectangle { Image { id: background - anchors.fill: parent; source: "pics/background.png" + anchors.fill: parent; source: "../shared/pics/background.jpg" fillMode: Image.PreserveAspectCrop } } diff --git a/examples/declarative/tutorials/samegame/samegame3/Block.qml b/examples/declarative/tutorials/samegame/samegame3/Block.qml index 30a8d3a..7620104 100644 --- a/examples/declarative/tutorials/samegame/samegame3/Block.qml +++ b/examples/declarative/tutorials/samegame/samegame3/Block.qml @@ -8,11 +8,11 @@ Item { Image { id: img source: { if(type == 0){ - "pics/redStone.png"; + "../shared/pics/redStone.png"; } else if(type == 1) { - "pics/blueStone.png"; + "../shared/pics/blueStone.png"; } else { - "pics/greenStone.png"; + "../shared/pics/greenStone.png"; } } anchors.fill: parent diff --git a/examples/declarative/tutorials/samegame/samegame3/pics/background.png b/examples/declarative/tutorials/samegame/samegame3/pics/background.png deleted file mode 100644 index 3734a27..0000000 Binary files a/examples/declarative/tutorials/samegame/samegame3/pics/background.png and /dev/null differ diff --git a/examples/declarative/tutorials/samegame/samegame3/pics/blueStone.png b/examples/declarative/tutorials/samegame/samegame3/pics/blueStone.png deleted file mode 100644 index 20e43c7..0000000 Binary files a/examples/declarative/tutorials/samegame/samegame3/pics/blueStone.png and /dev/null differ diff --git a/examples/declarative/tutorials/samegame/samegame3/pics/greenStone.png b/examples/declarative/tutorials/samegame/samegame3/pics/greenStone.png deleted file mode 100644 index b568a19..0000000 Binary files a/examples/declarative/tutorials/samegame/samegame3/pics/greenStone.png and /dev/null differ diff --git a/examples/declarative/tutorials/samegame/samegame3/pics/redStone.png b/examples/declarative/tutorials/samegame/samegame3/pics/redStone.png deleted file mode 100644 index 36b09a2..0000000 Binary files a/examples/declarative/tutorials/samegame/samegame3/pics/redStone.png and /dev/null differ diff --git a/examples/declarative/tutorials/samegame/samegame3/samegame.qml b/examples/declarative/tutorials/samegame/samegame3/samegame.qml index c616397..168bf9b 100644 --- a/examples/declarative/tutorials/samegame/samegame3/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame3/samegame.qml @@ -13,7 +13,7 @@ Rectangle { Image { id: background - anchors.fill: parent; source: "pics/background.png" + anchors.fill: parent; source: "../shared/pics/background.jpg" fillMode: Image.PreserveAspectCrop } diff --git a/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml b/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml index 4c2ba43..85c2c93 100644 --- a/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml +++ b/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml @@ -16,11 +16,11 @@ Item { id:block Image { id: img source: { if(type == 0){ - "pics/redStone.png"; + "../../shared/pics/redStone.png"; } else if(type == 1) { - "pics/blueStone.png"; + "../../shared/pics/blueStone.png"; } else { - "pics/greenStone.png"; + "../../shared/pics/greenStone.png"; } } opacity: 0 @@ -38,11 +38,11 @@ Item { id:block velocity: 100; velocityDeviation:30; source: { if(type == 0){ - "pics/redStar.png"; + "../../shared/pics/redStar.png"; } else if (type == 1) { - "pics/blueStar.png"; + "../../shared/pics/blueStar.png"; } else { - "pics/greenStar.png"; + "../../shared/pics/greenStar.png"; } } } diff --git a/examples/declarative/tutorials/samegame/samegame4/content/pics/background.png b/examples/declarative/tutorials/samegame/samegame4/content/pics/background.png deleted file mode 100644 index 3734a27..0000000 Binary files a/examples/declarative/tutorials/samegame/samegame4/content/pics/background.png and /dev/null differ diff --git a/examples/declarative/tutorials/samegame/samegame4/content/pics/blueStar.png b/examples/declarative/tutorials/samegame/samegame4/content/pics/blueStar.png deleted file mode 100644 index ff9588f..0000000 Binary files a/examples/declarative/tutorials/samegame/samegame4/content/pics/blueStar.png and /dev/null differ diff --git a/examples/declarative/tutorials/samegame/samegame4/content/pics/blueStone.png b/examples/declarative/tutorials/samegame/samegame4/content/pics/blueStone.png deleted file mode 100644 index 20e43c7..0000000 Binary files a/examples/declarative/tutorials/samegame/samegame4/content/pics/blueStone.png and /dev/null differ diff --git a/examples/declarative/tutorials/samegame/samegame4/content/pics/greenStar.png b/examples/declarative/tutorials/samegame/samegame4/content/pics/greenStar.png deleted file mode 100644 index cd06854..0000000 Binary files a/examples/declarative/tutorials/samegame/samegame4/content/pics/greenStar.png and /dev/null differ diff --git a/examples/declarative/tutorials/samegame/samegame4/content/pics/greenStone.png b/examples/declarative/tutorials/samegame/samegame4/content/pics/greenStone.png deleted file mode 100644 index b568a19..0000000 Binary files a/examples/declarative/tutorials/samegame/samegame4/content/pics/greenStone.png and /dev/null differ diff --git a/examples/declarative/tutorials/samegame/samegame4/content/pics/redStar.png b/examples/declarative/tutorials/samegame/samegame4/content/pics/redStar.png deleted file mode 100644 index 0a4dffe..0000000 Binary files a/examples/declarative/tutorials/samegame/samegame4/content/pics/redStar.png and /dev/null differ diff --git a/examples/declarative/tutorials/samegame/samegame4/content/pics/redStone.png b/examples/declarative/tutorials/samegame/samegame4/content/pics/redStone.png deleted file mode 100644 index 36b09a2..0000000 Binary files a/examples/declarative/tutorials/samegame/samegame4/content/pics/redStone.png and /dev/null differ diff --git a/examples/declarative/tutorials/samegame/samegame4/content/pics/star.png b/examples/declarative/tutorials/samegame/samegame4/content/pics/star.png deleted file mode 100644 index defbde5..0000000 Binary files a/examples/declarative/tutorials/samegame/samegame4/content/pics/star.png and /dev/null differ diff --git a/examples/declarative/tutorials/samegame/samegame4/content/pics/yellowStone.png b/examples/declarative/tutorials/samegame/samegame4/content/pics/yellowStone.png deleted file mode 100644 index b1ce762..0000000 Binary files a/examples/declarative/tutorials/samegame/samegame4/content/pics/yellowStone.png and /dev/null differ diff --git a/examples/declarative/tutorials/samegame/samegame4/samegame.qml b/examples/declarative/tutorials/samegame/samegame4/samegame.qml index a228e60..c2e8018 100644 --- a/examples/declarative/tutorials/samegame/samegame4/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame4/samegame.qml @@ -12,7 +12,7 @@ Rectangle { Image { id: background - anchors.fill: parent; source: "content/pics/background.png" + anchors.fill: parent; source: "../shared/pics/background.jpg" fillMode: Image.PreserveAspectCrop } diff --git a/examples/declarative/tutorials/samegame/shared/pics/background.jpg b/examples/declarative/tutorials/samegame/shared/pics/background.jpg new file mode 100644 index 0000000..903d395 Binary files /dev/null and b/examples/declarative/tutorials/samegame/shared/pics/background.jpg differ diff --git a/examples/declarative/tutorials/samegame/shared/pics/blueStar.png b/examples/declarative/tutorials/samegame/shared/pics/blueStar.png new file mode 100644 index 0000000..ff9588f Binary files /dev/null and b/examples/declarative/tutorials/samegame/shared/pics/blueStar.png differ diff --git a/examples/declarative/tutorials/samegame/shared/pics/blueStone.png b/examples/declarative/tutorials/samegame/shared/pics/blueStone.png new file mode 100644 index 0000000..20e43c7 Binary files /dev/null and b/examples/declarative/tutorials/samegame/shared/pics/blueStone.png differ diff --git a/examples/declarative/tutorials/samegame/shared/pics/greenStar.png b/examples/declarative/tutorials/samegame/shared/pics/greenStar.png new file mode 100644 index 0000000..cd06854 Binary files /dev/null and b/examples/declarative/tutorials/samegame/shared/pics/greenStar.png differ diff --git a/examples/declarative/tutorials/samegame/shared/pics/greenStone.png b/examples/declarative/tutorials/samegame/shared/pics/greenStone.png new file mode 100644 index 0000000..b568a19 Binary files /dev/null and b/examples/declarative/tutorials/samegame/shared/pics/greenStone.png differ diff --git a/examples/declarative/tutorials/samegame/shared/pics/redStar.png b/examples/declarative/tutorials/samegame/shared/pics/redStar.png new file mode 100644 index 0000000..0a4dffe Binary files /dev/null and b/examples/declarative/tutorials/samegame/shared/pics/redStar.png differ diff --git a/examples/declarative/tutorials/samegame/shared/pics/redStone.png b/examples/declarative/tutorials/samegame/shared/pics/redStone.png new file mode 100644 index 0000000..36b09a2 Binary files /dev/null and b/examples/declarative/tutorials/samegame/shared/pics/redStone.png differ diff --git a/examples/declarative/tutorials/samegame/shared/pics/star.png b/examples/declarative/tutorials/samegame/shared/pics/star.png new file mode 100644 index 0000000..defbde5 Binary files /dev/null and b/examples/declarative/tutorials/samegame/shared/pics/star.png differ diff --git a/examples/declarative/tutorials/samegame/shared/pics/yellowStone.png b/examples/declarative/tutorials/samegame/shared/pics/yellowStone.png new file mode 100644 index 0000000..b1ce762 Binary files /dev/null and b/examples/declarative/tutorials/samegame/shared/pics/yellowStone.png differ -- cgit v0.12