Forums

OverviewV-Play 1 SupportQML properties? › Re: QML properties?

OverviewV-Play 1 SupportQML properties? › Re: QML properties?
#4086

Christian
V-Play Team

Yes this is expected behavior. You can compare a QML file like a class definition, and once you call Qt.createObject() or createEntity() or whenever you put this QML component as a child to some other QML file, an instance, of this class / qml definition is created. And each of these instances holds an own JavaScript context. So put your gamelogic component only once in a top-level item, like in the Level.qml file or in the GameScene.qml file. This is also how it is done in the tutorial link above.

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