Forums

OverviewV-Play 1 Support › fontloader question

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6369

    Michael

    Hi

    Sorry if this ihas been asked before. Taking the Multilevelmultiscene demo as example, I thought I could put a fontloader in the SceneBase.qml so then the font would be available in higher-level qmls like SelectLevelScene but the font can’t be found. I wonder why, or what is the way to specific the font.family: property in that case? Or it’s no good that way, and I really need to include a FontLoader in each upper qml like SelectLevelScene etc?

    Cheers, Michael.

    #6373

    Alex
    V-Play Team

    Hi Michael,

    did you try putting the FontLoader in your GameWindo like we did e.g. in our ChickenOutbreak demo game?

    FontLoader {
      id: fontHUD
      source: "fonts/pf_tempesta_seven_compressed.ttf"
    }

    and then use it like this:

    Text {
        // ...
        font.family: fontHUD.name
      }

    Cheers,
    Alex

     

     

    #6374

    Alex
    V-Play Team

    Hi again,

    property alias fontHUD: fontHUD
    FontLoader {
      id: fontHUD
      // ...
    }

    If you add an alias to the item then you can also use the FontLoader in the SceneBase.

    Cheers,
    Alex

     

    #6376

    Michael

    Thanks alot Alex. The first tip was appreciated – more straightforward, and its reach more ‘global’!

    Cheers, Michael.

Viewing 4 posts - 1 through 4 (of 4 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
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