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

Felgo Games Documentation

Felgo Games provide a specialized set of QML components for building 2D games on top of Qt for multiple platforms, with the same source code. They are part of the Felgo SDK.

QML Introduction

QML stands for "Qt Markup Language" and is a declarative language designed to describe the user interface of a program: both what it looks like, and how it behaves. In QML, a user interface is specified as a tree of objects with properties. This tree is also often referred to as Scene Graph, because when the parent item moves all children will follow. JavaScript is used as a scripting language in QML. In this section we will cover the basics of QML and its advantages by an example.

As code speaks more than 1000 words, here is a QML example implementing the following:

  • Displays a white background Rectangle with 800x600 px
  • Adds a grey button element which changes the color from grey to blue while pressed
  • The button is draggable
  • The button tracks the number of presses and displays it in its text element
  • The button gets invisible after it got pressed 10 times.

How many lines of code would it take you to develop this application with the same functionality in another programming language? With QML, it is just 30 lines, excluding the comments and empty lines:

 import QtQuick 2.0 // for accessing all QML elements like Rectangle, Text or MouseArea
 import Felgo 4.0 // for accessing all Felgo elements like GameWindow

 GameWindow {

   Rectangle {
     // background rectangle filling whole screen with black color
     color: "#000000" // black color, open up color picker with Ctrl+Alt+Space
     anchors.fill: parent // make as big as parent GameWindow
   }

   Scene {

     Rectangle {
       id: button
       color: mouseArea.pressed ? "blue" : "lightgrey" // make the button blue when pressed
       x: 100
       y: 50
       width: 100
       height: 40
       visible: pressCount < 10 // after the button being pressed more than 10 times, it gets invisible

       property int pressCount: 0 // initialize with 0, increase in onPressed

       Text {
         text: "Pressed " + button.pressCount + " times" // this will automatically update when pressCount changes
         color: "black"
         anchors.centerIn: parent
       }

       MouseArea {
         id: mouseArea
         anchors.fill: parent // make the touchable area as big as the button
         drag.target: button // this forwards the dragging to the button

         onPressed: {
             button.pressCount++ // increase pressCount property by 1 each time the button is pressed
         }
       }
     }
   }// Scene
 }// GameWindow

Felgo Games Topic Overview

Supported Platforms

Mobile iOS Version 13.0 and above (arm64 architecture and simulator)
Android Version 6.0 ("Lollipop", API level 23) and above
Desktop macOS 64-bit Apple macOS 11.3 or later with Xcode 13 or later
Windows 32- or 64-bit Microsoft Windows 7 or later
Linux 64-bit Linux Ubuntu 20.04, Debian 11, Arch Linux 2020.01.01 or later and equivalent
Embedded Raspberry Pi, i.MX6, i.MX8 platforms, Nvidia Tegra and similar (contact us for more information about these platforms)

Felgo Benefits for Qt Developers

Felgo, a Qt Technology Partner of The Qt Company, enhances the Qt framework with many components and its gaming API used in hundreds of games.

Existing Qt games can benefit from this gaming API and Felgo plugins, because they work as an extension of the Qt framework and work together with existing projects. As a Qt developer, you get the following benefits by using Felgo:

And of course as part of Felgo you can use leading Qt plugins that enable you to:

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded