Advertisement
Guest User

Untitled

a guest
Sep 9th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     // in my main.qml file
  2.     //
  3.     state: "splash"
  4.  
  5.     states: [
  6.       State {
  7.         name: "splash"
  8.         PropertyChanges { target: splashScene; opacity: 1}
  9.         PropertyChanges { target: starmapScene; opacity: 0}
  10.       },
  11.       State {
  12.         name: "starmap"
  13.         PropertyChanges { target: splashScene; opacity: 0}
  14.         PropertyChanges { target: starmapScene; opacity: 1}
  15.       }
  16.     ]
  17.  
  18.     onStateChanged: console.log("HUD: switched to state '", state, "'")
  19.  
  20.  
  21.     // in my splash scene
  22.     //
  23.     MouseArea {
  24.         anchors.fill: parent
  25.         onClicked: {
  26.             if (gameWindow.activeScene === splashScene) {
  27.                 console.log("onClick called")
  28.                 gameWindow.state = "starmap" // let state transition handle opacity animation
  29.                 //splashScene.opacity = 0
  30.                 //starmapScene.opacity = 1
  31.             }
  32.         }
  33.     }
  34.  
  35.     // I've tried this one and the transition
  36.     //Behavior on opacity {
  37.     //  NumberAnimation { duration: 10000 }
  38.    // }
  39.  
  40.     transitions: [
  41.         Transition {
  42.             NumberAnimation {
  43.                 property: "opacity"
  44.                 easing.type: Easing.InOutQuad
  45.                 duration: 10000
  46.             }
  47.         }
  48.     ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement