Forums

OverviewV-Play 2 Support (Qt 5) › Screen density on Surface Pro 4

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

    Megan

    Hello!  I am developing on a Surface Pro 4 (Windows 10) which has high pixel density.  The scaling is only set to .25 though.  Is there a way to detect and correct?

     

    From the application logs:

    VPlayApplication: read Screen infos – size: QSize(2736, 1824) , availableSize: QSize(2736, 1744) QRect(0,0 2736×1744) QSize(2736, 1744) QRect(0,0 2736×1744) QRect(0,0 2736×1824) physcislDotsPerInch (might not be accurate): 267.544 , logicalDotsPerInch: 192 , physicalSize [mm] (might not be accurate depending on platform): QSizeF(260, 173)

    setting extrafileSelectorList to (“hd2”, “hd”, “sd”) , allFileSelectors: (“hd2”, “hd”, “sd”, “en_US”, “windows”, “winnt”)

    setting internalContentScaleFactorForImages which is used for MultiResolutionImage contextProperty to 0.25

    VPlayApplication: setting screenDpi contextProperty to 192

    VPlayApplication: setting devicePixelRatio contextProperty to 1

    #13140

    Günther
    V-Play Team

    Hi Megan!

    If you are referring to the log output:
    “setting internalContentScaleFactorForImages which is used for MultiResolutionImage contextProperty to 0.25”
    This means that when using a MultiResolutionImage that provides dynamic image switching, the best quality (+hd2) is used. The hd2 image would be quadruple the size of the sd version, thus the scale of 0.25 is applied to get the same final size in your UI, while still using the better image.

    Designing your UI to look nice on all devices (no matter the resolution or pixel density) is another matter:

    • For V-Play Games this is achieved with the Scene scaling mechanism.
    • For V-Play Apps, the usual solution is to not specify absolute pixel sizes for your UI elements, but a density independent size using the dp function.

    Hope this answers your question?

    Best,
    Günther

    #13343

    Megan

    Ah yes, you are right — that makes sense.  Thank you!  It is working as expected then and my thinking was backwards after a day debugging and refactoring other areas of my code.  (And yes, this is for a game using Scene Scaling and multiple texture packer files etc).

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