CurrencyPackageElement.qml Example File

demos/ChickenOutbreak2/qml/CurrencyPackageElement.qml
 import QtQuick 2.0
 import Felgo 3.0

 Item {
   id: currencyPackage
   width: parent.width
   height: 70

   property alias source: image.source
   property alias message: message.text
   property bool isMoney: true
   property string packID: ""
   property alias description: description.text

   signal bought

   Rectangle {
     anchors.fill: parent
     color: "#cccccc"
     opacity: 0.8

     Image {
       id: image
       anchors.verticalCenter: parent.verticalCenter
       width: 50
       height: 50
       anchors.left: parent.left
       anchors.leftMargin: 10
     }

     Column {
       anchors.top: parent.top
       anchors.topMargin: 10
       anchors.left: image.right
       anchors.leftMargin: 10
       anchors.right: parent.right
       anchors.rightMargin: 10

       Item {
         width: parent.width
         height: description.height
         MenuText {
           id: description
           font.pixelSize: 20
           color: "#000000"
           anchors.horizontalCenter: parent.horizontalCenter
         }
       }

       Item {
         width: parent.width
         height: message.height
         MenuText {
           id: message
           font.pixelSize: 20
           color: "#000000"
           anchors.horizontalCenter: parent.horizontalCenter
         }
       }
     }
   }

   MouseArea {
     anchors.fill: parent
     onClicked: {
       bought()
       store.buyItem(currencyPackage.packID)
       parent.scale = 1.0
     }
     onPressed: {
       parent.scale = 0.85
     }
     onReleased: {
       parent.scale = 1.0
     }
     onCanceled: {
       parent.scale = 1.0
     }
   }
 }

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support