InfoView.qml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /**
  2. * Copyright (c) 2011 Nokia Corporation.
  3. */
  4. import QtQuick 1.0
  5. Item {
  6. id: container
  7. objectName: "infoView"
  8. anchors.fill: parent
  9. opacity: 0
  10. // Mouse area for hiding this info view
  11. MouseArea {
  12. anchors.fill: parent
  13. onClicked: container.opacity = 0;
  14. }
  15. Rectangle {
  16. anchors.fill: parent
  17. anchors.margins: 30
  18. radius: 5
  19. color: "black"
  20. border.color: "white"
  21. border.width: 2
  22. Behavior on opacity {
  23. PropertyAnimation {
  24. duration: 500
  25. }
  26. }
  27. Flickable {
  28. id: flickable
  29. anchors {
  30. fill: parent
  31. topMargin: 20
  32. leftMargin: 10
  33. rightMargin: 5
  34. bottomMargin: 10
  35. }
  36. contentHeight: infoText.height + closeButton.height
  37. clip: true
  38. Text {
  39. id: infoText
  40. width: flickable.width - 10 // Save room for scroll bar
  41. color: "white"
  42. wrapMode: Text.WrapAtWordBoundaryOrAnywhere
  43. font.pixelSize: container.width * 0.055
  44. text: {
  45. infoText.text =
  46. "<a href=\"https://projects.developer.nokia.com/quickhit\">" +
  47. "QuickHit</a>" +
  48. "<p>A Nokia Developer Qt Quick Game Example</p>" +
  49. "<p>QuickHit is essentially a basic arcade-style " +
  50. "shooting game, but differentiated from other such " +
  51. "games by its levels which are implemented as " +
  52. "separate Qt plug-ins.</p>";
  53. if (GameEngine.isSymbian()) {
  54. // IAP API is only available on Symbian
  55. infoText.text +=
  56. "<p>Try In-App Purchase to buy more " +
  57. "levels by selecting 'Buy Levels' from " +
  58. "the main menu.</p>";
  59. }
  60. infoText.text +=
  61. "</p>Sounds were loaded from freesound.org, under " +
  62. "Creative Commons Sampling Plus 1.0 license.</p>" +
  63. "<p>The sounds were created by:<br />" +
  64. "HardPCM, Matt_G, klankbeeld, steveygos93, " +
  65. "joe93barlow, ljudman, Jovica, patchen and " +
  66. "nthompson</p><br />";
  67. }
  68. onLinkActivated: Qt.openUrlExternally(link);
  69. }
  70. // Close button
  71. TextLabel {
  72. id: closeButton
  73. width: parent.width * 0.75
  74. height: 60
  75. anchors {
  76. horizontalCenter: parent.horizontalCenter
  77. rightMargin: 5
  78. bottom: parent.bottom
  79. }
  80. // Close icon
  81. Image {
  82. id: icon
  83. anchors {
  84. verticalCenter: parent.verticalCenter
  85. left: parent.left
  86. }
  87. source: "gfx/icon_exit.png"
  88. smooth: true
  89. }
  90. mouseAreaEnabled: true
  91. text: "Close"
  92. textLeftMargin: icon.width
  93. onClicked: container.opacity = 0;
  94. }
  95. } // Flickable
  96. ScrollBar { flickableItem: flickable }
  97. }
  98. }