Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Multi-Scene-Multi-Level Demo

 import Felgo 4.0
 import QtQuick 2.0
 import "../common"

 SceneBase {
   id: selectLevelScene

   // signal indicating that a level has been selected
   signal levelPressed(string selectedLevel)

   // background
   Rectangle {
     anchors.fill: parent.gameWindowAnchorItem
     color: "#ece468"
   }

   // back button to leave scene
   MenuButton {
     text: "Back"
     // anchor the button to the gameWindowAnchorItem to be on the edge of the screen on any device
     anchors.right: selectLevelScene.gameWindowAnchorItem.right
     anchors.rightMargin: 10
     anchors.top: selectLevelScene.gameWindowAnchorItem.top
     anchors.topMargin: 10
     onClicked: backButtonPressed()
   }

   // levels to be selected
   Grid {
     anchors.centerIn: parent
     spacing: 10
     columns: 5
     MenuButton {
       text: "1"
       width: 50
       height: 50
       onClicked: {
         levelPressed("Level1.qml")
       }
     }
     MenuButton {
       text: "2"
       width: 50
       height: 50
       onClicked: {
         levelPressed("Level2.qml")
       }
     }
     MenuButton {
       text: "3"
       width: 50
       height: 50
       onClicked: {
         levelPressed("Level3.qml")
       }
     }
     Repeater {
       model: 10
       MenuButton {
         text: " "
         width: 50
         height: 50
       }
Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded