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

Currency

The Currency item describes a single virtual currency you want to offer within your game. More...

Import Statement: import Felgo 4.0
Inherits:

Item

Properties

Detailed Description

The Currency item describes a single currency you want to offer within your game's store assets to buy virtual credits.

Virtual currencies are used to provide a currency like coins or credits within your game play. Currencies can be purchased in volume (bundled within a CurrencyPack) by your players with an purchase type of StorePurchase.

Your game needs at least one Currency and one CurrencyPack defined in order to use offer a virtual economy.

A simple example for a currency (named "Gold") and a purchaseable currency pack (named "10 Pieces of Gold") looks like the following:

 Store {
   currencies: [
     Currency { id: goldCurrency; itemId: "currency_gold_id"; name: "Gold"; }
   ]

   currencyPacks: [
     CurrencyPack {
       id: gold10Pack
       itemId: "gold_pack_10_id"
       name: "10 Pieces of Gold"
       currencyId: goldCurrency.itemId // The currency you want to use for this pack
       currencyAmount: 10
       purchaseType:  StorePurchase { id: gold10Purchase; productId: gold10Pack; }
     }
   ]
 }

Note: The virtual economic model allows to define multiple currencies within the same game, in most cases a single cirtual currency should however be sufficient.

Property Documentation

balance : int

A read-only property which holds the current balance of the currency. You can use property binding to display the current amount available with the help of a Text item:

 Text {
   text: "Available Gold: %1".arg(goldCurrency.balance)
 }

description : string

A meta field for giving the currency a description to display to the user. This property is not used internally but you can use it to display a common description within your game wherever you need to.

Be sure to set this property if you're making use of Store::printStoreProductLists as this greatly simplifies the publishing process of your game.


itemId : string

The itemId is a unique identifier for this currency within your virtual store. The property is mandatory.


name : string

A meta field for giving the currency a name to display to the user. This property is not used internally but you can use it to display a common name within your game wherever you need to.

Be sure to set this property if you're making use of Store::printStoreProductLists as this greatly simplifies the publishing process of your game.


Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded