Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Stack With Friends Demo

 import QtQuick 2.0
 import Felgo 3.0

 Item {
   id: ratingDialog
   width: levelScene.gameWindowAnchorItem.width
   height: levelScene.gameWindowAnchorItem.height
   anchors.centerIn: parent

   enabled: opacity > 0 // otherwise this item would receive mouse events when opaque

   Behavior on opacity {
     NumberAnimation { duration: 150}
   }

   // rateValue is between 1-5
   signal levelRated(int rateValue)

   property int currentRating : 0

   onLevelRated: {
     opacity = 0
   }

   MouseArea {
     anchors.fill: parent
   }

   Rectangle {
     color: "black"
     anchors.fill: parent
     opacity: 0.9
   }

   Row {
     anchors.centerIn: parent
     spacing: 5

     Item {
       width: 50
       height: 50
       visible: currentRating >= 1
       MultiResolutionImage {
         source: "../../../assets/img/star-big.png"
       }
       MouseArea {
         anchors.fill: parent
         onClicked: {
           levelRated(1)
         }
       }
     }
     Item {
       width: 50
       height: 50
       visible: currentRating >= 2
       MultiResolutionImage {
         source: "../../../assets/img/star-big.png"
       }
       MouseArea {
         anchors.fill: parent
         onClicked: {
           levelRated(2)
         }
       }
     }
     Item {
       width: 50
       height: 50
       visible: currentRating >= 3
       MultiResolutionImage {
         source: "../../../assets/img/star-big.png"
       }
       MouseArea {
         anchors.fill: parent
         onClicked: {
           levelRated(3)
         }
       }
     }
     Item {
       width: 50
       height: 50
       visible: currentRating >= 4
       MultiResolutionImage {
         source: "../../../assets/img/star-big.png"
       }
       MouseArea {
         anchors.fill: parent
         onClicked: {
           levelRated(4)
         }
       }
     }
     Item {
       width: 50
       height: 50
       visible: currentRating >= 5
       MultiResolutionImage {
         source: "../../../assets/img/star-big.png"
       }
       MouseArea {
         anchors.fill: parent
         onClicked: {
           levelRated(5)
         }
       }
     }
     Item {
       width: 50
       height: 50
       visible: currentRating < 1
       MultiResolutionImage {
         source: "../../../assets/img/star-no-big.png"
       }
       MouseArea {
         anchors.fill: parent
         onClicked: {
           levelRated(1)
         }
       }
     }
     Item {
       width: 50
       height: 50
       visible: currentRating < 2
       MultiResolutionImage {
         source: "../../../assets/img/star-no-big.png"
       }
       MouseArea {
         anchors.fill: parent
         onClicked: {
           levelRated(2)
         }
       }
     }
     Item {
       width: 50
       height: 50
       visible: currentRating < 3
       MultiResolutionImage {
         source: "../../../assets/img/star-no-big.png"
       }
       MouseArea {
         anchors.fill: parent
         onClicked: {
           levelRated(3)
         }
       }
     }
     Item {
       width: 50
       height: 50
       visible: currentRating < 4
       MultiResolutionImage {
         source: "../../../assets/img/star-no-big.png"
       }
       MouseArea {
         anchors.fill: parent
         onClicked: {
           levelRated(4)
         }
       }
     }
     Item {
       width: 50
       height: 50
       visible: currentRating < 5
       MultiResolutionImage {
         source: "../../../assets/img/star-no-big.png"
       }
       MouseArea {
         anchors.fill: parent
         onClicked: {
           levelRated(5)
         }
       }
     }
   }

   MultiResolutionImage {
     source: "../../../assets/img/gamescene-top.png"
     anchors.horizontalCenter: parent.horizontalCenter
     Item {
       width: 39
       height: 39
       x: 12
       y: -1
       MultiResolutionImage {
         source: "../../../assets/img/back-button.png"
         anchors.centerIn: parent
       }
       MouseArea {
         anchors.fill: parent
         onClicked: ratingDialog.opacity = 0
       }
Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded