CreditsScene.qml Example File

demos/ChickenOutbreak2/qml/CreditsScene.qml
 import QtQuick 2.0
 import Felgo 3.0

 SceneBase {
   id: creditsScene
   onBackButtonPressed: {
     audioManager.play(audioManager.idMENUCLICK)
     window.state = "main"
   }

   Component.onCompleted: opacity = 1

   MultiResolutionImage {
     source: "../assets/background-wood2.png"
     anchors.centerIn: parent
   }

   CreditsSceneDecoration {}

   Rectangle {
     color: "black"
     opacity: 0.5
     width: creditsScene.width - 80
     anchors.horizontalCenter: creditsScene.horizontalCenter
     height: 280
     y: 132
   }

   Image {
     source: "../assets/sign.png"
     anchors.horizontalCenter: parent.horizontalCenter
     y: -118
     width: 300
     height: 270
   }

   MenuText {
     text: qsTr("Credits")
     font.pixelSize: 60
     y: 55
     anchors.horizontalCenter: parent.horizontalCenter
     rotation: -2
   }

   Column {
     anchors.horizontalCenter: parent.horizontalCenter
     y: 150

     Item {
       width: 1
       height: 25
     }

     MenuText {
       text: qsTr("Sound:")
       font.pixelSize: 26
       anchors.horizontalCenter: parent.horizontalCenter
     }

     MenuText {
       text: "\"Air Ducts\""
       font.pixelSize: 26
       anchors.horizontalCenter: parent.horizontalCenter
     }

     MenuText {
       text: "(playonloop.com)"
       font.pixelSize: 26
       anchors.horizontalCenter: parent.horizontalCenter
     }

     Item {
       width: 1
       height: 25
     }

     Item {
       width: vplayCredits.width
       height: vplayCredits.height

       Column {
         id: vplayCredits
         width: creditsScene.width
         spacing: 4

         MenuText {
           text: qsTr("Source code available with")
           anchors.horizontalCenter: parent.horizontalCenter
         }
         Item {
           x: 3
           width: parent.width
           height: vplayLogo.height
           Image {
             id: vplayLogo
             anchors.horizontalCenter: parent.horizontalCenter
             source: "../assets/felgo.png"
             // the image size is bigger (for hd2 image), so only a single image no multiresimage can be used
             // this scene is not performance sensitive anyway!
             fillMode: Image.PreserveAspectFit
             height: 50
           }
         }

         MenuText {
           text: qsTr("Build your own game in days")
           anchors.horizontalCenter: parent.horizontalCenter
         }
       }

       MouseArea {
         anchors.fill: vplayCredits
         onClicked: {
           audioManager.play(audioManager.idMENUCLICK)
           nativeUtils.openUrl("https://felgo.com/showcases/?utm_medium=game&utm_source=chickenoutbreak2&utm_campaign=chickenoutbreak2#chicken_outbreak2");
         }
       }
     }
   }

   MenuButton {
     anchors.horizontalCenter: parent.horizontalCenter
     anchors.bottom: parent.bottom
     anchors.bottomMargin: 20
     z: 15

     text: qsTr("Back")

     onClicked: {
       audioManager.play(audioManager.idMENUCLICK)
       window.state = "main"
     }
   }

   function enterScene() {}
 }

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support