IngameMenu.qml Example File

demos/ChickenOutbreak/qml/IngameMenu.qml
 import QtQuick 2.0
 import Felgo 3.0 // for the vplayScheduler enum values

 Column {
   spacing: 2
   anchors.centerIn: parent

   MenuButton {
     text: qsTr("Resume")
     onClicked: scene.state = "" // reset to default state, so hide this menu
   }

   MenuButton {
     text: qsTr("Restart")
     onClicked: {
       level.restartGame();
       scene.state = "" // reset to default state, so hide this menu
     }
   }

   MenuButton {
     text: qsTr("Toggle Physics Debug")
     onClicked: {
       physicsWorld.debugDrawVisible = !physicsWorld.debugDrawVisible
     }
   }

   MenuButton {
     text: vplayScheduler.schedulingMethod === VPlayScheduler.None ? qsTr("Current Scheduler: every update") : qsTr("Current Scheduler: accumulated")
     onClicked: {
       if(vplayScheduler.schedulingMethod === VPlayScheduler.None)
         vplayScheduler.schedulingMethod = VPlayScheduler.Accumulated
       else
         vplayScheduler.schedulingMethod = VPlayScheduler.None
     }
   }

   MenuButton {
     text: qsTr("Toggle Background Movement")
     onClicked: {
       levelBackground.running = !levelBackground.running
     }
   }
 }

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