CarChallenge 3D Demo
import QtQuick 2.0
import Felgo 3.0
Item {
id: menu
property alias itemEditor: menuSettings.itemEditor
property bool miniMapOn: true
state: "intro"
MouseArea {
anchors.fill: parent
enabled: menu.state !== "game"
}
MenuOverview {
id: menuOverview
onClickedAbout: {
menu.state = "about"
menuButton.toArrow()
}
onClickedCamera: {
menu.state = "camera"
menuButton.toArrow()
}
onClickedSettings: {
menu.state = "settings"
menuButton.toArrow()
}
onClickedMinimap: menu.miniMapOn = !menu.miniMapOn
}
MenuAbout {
id: menuAbout
}
MenuSettings {
id: menuSettings
}
StartButton {
id: startButton
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: 10
onClicked: {
menu.state = "game"
}
}
MenuButton {
id: menuButton
anchors.right: parent.right
anchors.rightMargin: 5
anchors.top: parent.top
anchors.topMargin: 5
visible: menu.state != "intro"
onClicked: {
if(menu.state == "game") {
menu.state = "menu"
toCross()
} else if(menu.state == "menu") {
menu.state = "game"
toDefault()
} else if(menu.state == "about" || menu.state == "camera" || menu.state == "settings") {
menu.state = "menu"
toCross()
}
}
}
states: [
State {
name: "intro"
PropertyChanges {target: menuAbout; opacity: 1}
PropertyChanges {target: startButton; opacity: 1}
},
State {
name: "game"
},
State {
name: "menu"
PropertyChanges {target: menuOverview; opacity: 1}
},
State {
name: "about"
PropertyChanges {target: menuAbout; opacity: 1}
},
State {
name: "camera"
PropertyChanges {target: menuCamera; opacity: 1}
},
State {
name: "settings"
PropertyChanges {target: menuSettings; opacity: 1}
}