Forums

OverviewV-Play Plugins Support › nested item gameWindowAnchorItem

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #13892

    Bas

    hi,

     

    i have a item in an item in a scene and want to fill the inner rect fullscreen  using gameWindowAnchorItem

    hoe can i do that? or is there another way?

    #13894

    Günther
    V-Play Team

    Hi Bas!

    As you probably know, it is not possible to use anchoring in this case, as anchoring is only possible to sibling items or the parent in the QML tree.

    The solution is to position and size the item manually by setting the x/y and width/height properties accordingly:

    import VPlay 2.0
    import QtQuick 2.0
    
    GameWindow {
      id: gameWindow
    
      activeScene: scene
      screenWidth: 960
      screenHeight: 640
    
      Scene {
        id: scene
    
        width: 480
        height: 320
    
        // fills scene
        Item {
          anchors.fill: parent
    
          // fills gamewindow
          Rectangle {
            x: scene.gameWindowAnchorItem.x
            y: scene.gameWindowAnchorItem.y
            width: scene.gameWindowAnchorItem.width
            height: scene.gameWindowAnchorItem.height
            color: "green"
          }
        }
      }
    }
    

     

    Cheers,

    Günther

    #13895

    Bas

    ah ok,

    thanx!

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