demos/declarative/snake/content/Cookie.qml
changeset 37 758a864f9613
parent 30 5dc02b23752f
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
    57     Image {
    57     Image {
    58         id: img
    58         id: img
    59         anchors.fill: parent
    59         anchors.fill: parent
    60         source: "pics/cookie.png"
    60         source: "pics/cookie.png"
    61         opacity: 0
    61         opacity: 0
    62         Behavior on opacity { NumberAnimation { duration: 100 } }
       
    63         Text {
    62         Text {
    64             font.bold: true
    63             font.bold: true
    65             anchors.verticalCenter: parent.verticalCenter
    64             anchors.verticalCenter: parent.verticalCenter
    66             anchors.horizontalCenter: parent.horizontalCenter
    65             anchors.horizontalCenter: parent.horizontalCenter
    67             text: value
    66             text: value
    85         State{ name: "DeathState"; when: dying == true
    84         State{ name: "DeathState"; when: dying == true
    86             StateChangeScript { script: particles.burst(50); }
    85             StateChangeScript { script: particles.burst(50); }
    87             PropertyChanges { target: img; opacity: 0 }
    86             PropertyChanges { target: img; opacity: 0 }
    88         }
    87         }
    89     ]
    88     ]
       
    89     transitions: [
       
    90         Transition {
       
    91             NumberAnimation { target: img; property: "opacity"; duration: 100 }
       
    92         }
       
    93     ]
    90 }
    94 }