Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Qt 4.7
- import QtMultimediaKit 1.1
- Item {
- id: mainview
- height: 360; width: 640
- property string statepoint: "start"
- property bool muted: false
- states: [
- State { name: "intro"; when: statepoint == "intro"
- PropertyChanges { target: introtrack; property: "playing"; value: !muted }
- },
- State { name: "menu"; when: statepoint == "menu"
- PropertyChanges { target: introtrack; property: "playing"; value: !muted }
- },
- State { name: "carbrowser"; when: statepoint == "carbrowser" }
- ]
- Rectangle { anchors.fill: parent; color: "black" } // Canvas
- Intro { id: intr; height: parent.height; width: parent.width; visible: statepoint == "intro" }
- MainMenu { height: parent.height; width: parent.width; visible: statepoint == "menu" }
- CarBrowser { height: parent.height; width: parent.width; visible: statepoint == "carbrowser" }
- Audio {
- id: introtrack
- volume: 0.5
- source: "sounds/intro.mp3"
- playing: { statepoint == "intro" || statepoint == "menu" || statepoint == "carbrowser" ? true : false }
- }
- Component.onCompleted: { statepoint = "intro"; intr.begin() }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement