Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // in my main.qml file
- //
- state: "splash"
- states: [
- State {
- name: "splash"
- PropertyChanges { target: splashScene; opacity: 1}
- PropertyChanges { target: starmapScene; opacity: 0}
- },
- State {
- name: "starmap"
- PropertyChanges { target: splashScene; opacity: 0}
- PropertyChanges { target: starmapScene; opacity: 1}
- }
- ]
- onStateChanged: console.log("HUD: switched to state '", state, "'")
- // in my splash scene
- //
- MouseArea {
- anchors.fill: parent
- onClicked: {
- if (gameWindow.activeScene === splashScene) {
- console.log("onClick called")
- gameWindow.state = "starmap" // let state transition handle opacity animation
- //splashScene.opacity = 0
- //starmapScene.opacity = 1
- }
- }
- }
- // I've tried this one and the transition
- //Behavior on opacity {
- // NumberAnimation { duration: 10000 }
- // }
- transitions: [
- Transition {
- NumberAnimation {
- property: "opacity"
- easing.type: Easing.InOutQuad
- duration: 10000
- }
- }
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement