Forums

OverviewV-Play 2 Support (Qt 5) › Nested Scenes / Making a picture-in-picture function

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #11857

    Ben

    Hi,

     

    Is it possible to have a scene inside another scene? I would like to make a game by V-Play. There has a menu of stage selection. Each stage will show its name with preview image. It is not only a static image, it will show how is the scene look like and your character is playing for it. It is dynamic. Somehow it should be quite similar to TV’s picture-in-picture function.

     

    I have tried to declare in this way:

     

    Scene {
     id: gameScene
     width: 480;
     height: 320;
     MyScene { // Logical size is same as 480x320
     }
    }

     

    However, the scaling of MyScene is incorrect. It don’t fit on parent’s logical size.

    I have also tried:

    Scene {
      id: gameScene
      width: 480;
      height: 320;
      GameWindowItem {
        width: 480;
        height: 320;
    
        MyScene { // Logical size is same as 480x320
        }
      }
    }

    The scaling is still wrong. Any tips for this problem?

    Thanks for any advise!

     

     

    • This topic was modified 2 years, 11 months ago.
    • This topic was modified 2 years, 11 months ago.
    #11863

    Alex
    V-Play Team

    Hi Ben,

    I’m not sure if I got your use case quite right, so you basically try to give a “real-time” preview of every stage within your overview scene?

    Every game should use at most one GameWindow item and a set of Scene items as direct children (scenes should not be stacked into each other as already found out). So for your use case it’s probably best to just use a scene for listing all your stages (e.g. “StagesScene”) and put all the individual stages into an Item (or Rectangle or whatever) wrapper item. You can reuse these items in your concrete “GameScene” later on).

    Here is a short listing of the idea behind it:

    StagesScene:

    Scene {
    
      // List your stages
      Column {
        Stage {}
        Stage {}
        Stage {}
      }
    }

    GameScene:

    Scene {
      Stage {}
    }

    Stage:

    Item {
      ...
    }

    Does this make sense to you?

    Best,

    Alex

    #11864

    Ben

    Hi Alex,

     

    Thanks for your reply! I just found an example image that may explain my problem:

    https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ112IXZsl4aG2k9j7iQcBe_zkPBqCjaECxcRZ7BM6hnBe0b7Np

     

    In this image, it has shown several “emulator game” for user to select to play. I want to make similar things but not using static image / video. I wish to embed a scene object and show a real game play.

     

    For your suggestion, do you mean that I need to scale the Stage item by myself?

     

     

    #11868

    Alex
    V-Play Team

    I see!

    Regarding content scaling you don’t have to change anything from your side. As all of your Stages are children of a Scene item they get scaled in their role as children automatically. So if your Scenes use a base size of 480×320 you can use that size in your Stage items as reference size too. For your overview you can then set the scale property or overwrite the Stage items’ width and height properties (assumed that you use relative sizes in your Stage, otherwise the scale property would be the way to go).

    Best,

    Alex

    #11870

    Ben

    Hi Alex,

     

    I see.Let’s me try about it.

    Thanks!

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