Forums

OverviewV-Play 2 Support (Qt 5)Not using GameWindow as root item › Reply To: Not using GameWindow as root item

OverviewV-Play 2 Support (Qt 5)Not using GameWindow as root item › Reply To: Not using GameWindow as root item
#11867

Alex
V-Play Team

Hey Ben,

Please see following demo code:

import VPlay 2.0
import QtQuick 2.0
import QtQuick.Controls 1.4

ApplicationWindow {
  id: window

  visible: true;
  width: 960
  height: 640

  GameWindowItem {
    id: gameWindow
    anchors.fill: parent
  }

  Scene {
    id: scene

    width: 480
    height: 320

    Rectangle {
      anchors.fill: parent
      color: "red"
    }

    Rectangle {
      anchors.centerIn: parent
      width: 400
      height: 300
      color: "blue"
    }
  }
}

There are two important things:

1. GameWindowItem & Scenes are siblings, so in that case you don’t need to wrap Scenes into the GameWindowItem (it’s just an item and not a window, as the name implies)

2. The GameWindowItem needs the id “gameWindow”, otherwise scenes can’t reference it the correct way as of now.

We will add that information to the corresponding documentation part, thanks for pointing that out!

Best,

Alex

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