Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 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 Felgo. 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 8 years, 4 months ago by  benlau.
    • This topic was modified 8 years, 4 months ago by  benlau.
    #11863

    Alex
    Felgo 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
    Felgo 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.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded