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

Forums

OverviewFelgo 3 Support (Qt 5) › Handling different screen sizes and resolutions

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

    Darren

    Hi guys,

    I just noticed 2 bugs in my game…

    I want to deploy it to different phones / tablets with different screen sizes and resolutions.

    Bug1:

    I am using GameWindow and a GameScene which is set to 320*480 (my game is designed to have the phone / tablet held long side up).  My content displays correctly in the GameScene, however my game map is bigger than the GameScene and I just realised that the content goes over the edges of the GameScene and fills the entire GameWindow.  This is a problem because you will see more of the game area on different devices.

    I believed that using the GameWindow / GameScene setup, any content I put in the GameScene would only be displayed if it was within the boundaries of the GameScene.

    Am I now correct to say that content that goes outside the boundaries of the GameScene will actually be shown?  I believe the solution for me is to place content (for example 4 rectangles, one for each side) outside and around the GameScene with a high Z order, that will hide any GameScene content that goes outside it’s boundaries.  Is this the correct approach or have I misunderstood how it works?

     

    Bug2:

    I am using TexturePacker and TexturePackerAnimatedSpriteVPlay to display my sprites.  This appears to work correctly when I test on my computer and always displays the highest resolution sprites.  When I test on my phone however, it selects the medium resolution sprites – although my phone is capable of displaying the highest resolution.  I have tested it by putting the highest resolution sprites in each of the folders and found my phone displays these sprites without problem. I have also tested this on a Samsung tablet and have found the same problem – it automatically selects the medium resolution sprites, not the high resolution ones.

    The folders where my sprites are stored are called +hd and +hd2.

    Can you advise where I might be going wrong, or how it decides which folder to use for the resolution?

     

    Thank you

    Darren.

    #15742

    Günther
    Felgo Team

    Hi Darren!

    You can have a look at our tutorials about resolution and device independence. In short: yes, depending on the device you will have a slightly wider or higher game window if the screen aspect ratio is different from the scene. The tutorials show different ways how to handle this issue.

    The selected image quality for multi-resolution image switching depends on the actual scaling that is applied to your scene. If the scene scale factor is above 2 the +hd version is used, if its above 2.8 the +hd2 version is used. So it might be that on your tablet the hd version is used because the scale factor is still below 2.8. You can test different scale factors and the image switching as described here.

    Best,
    Günther

    #15744

    Darren

    Hi Günther,

    Thanks for your help…  I already had looked at the tutorials, I just wanted to confirm I understood how it worked correctly and my solution was right.

    I didn’t realise about the scaling factor for image quality though and will have to research that, particularly for the devices I’m using as the +hd version isn’t high enough resolution on them.

    Thanks again,

    Darren.

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