Currency

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

Import Statement: import VPlayPlugins.soomla 1.2
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.


Videos

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