OverviewFelgo 2 Support (Qt 5) › sp() and dp() function not accessible


Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #8438


    I need to scale text via font.pixelSize; The Docs say i should use the sp() function, but the example does not work. Here’s the code.

    import Felgo 3.0
    import QtQuick 2.0
    GameWindow {
      id: gameWindow
      Rectangle {
        width: parent.width
        height: gameWindow.dp(48)
        Text {
          text: "20sp"
          font.pixelSize: gameWindow.sp(20)

    Any workaround?




    Felgo Team

    Hi Jan,

    please update your SDK first to the latest version 2.2.0 – the density-independence functions were added there (see changelog).

    As mentioned in the density independence blog post, we generally recommend just using a Scene and GameWindow with the content scaling approach, especially for games. For apps that is different though – the density independent approach is better there..

    Cheers, Chris


Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

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
create apps
create games
cross platform
native performance
3rd party services
game network
level editor
easiest to learn
biggest time saving
best support