Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Forums

OverviewFelgo 1 Support › ParallaxScrollingBackground not visible in every resolution

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #5734

    GP

    Hi,

    I’m using ParallaxScrollingBackground for animated clouds in the background but apparently it’s not working in every resolution. I can’t see the clouds in the following resolutions: 320×480, 360×640, 480×854, 480×800

    In every other resolution it works perfectly fine.

    Here is my code:

        ParallaxScrollingBackground {
            movementVelocity: Qt.point(20,0)
            ratio: Qt.point(1.0,0.1)
            sourceImage: "../img/game/backgrounds/clouds-sd.png"
        }

    Cheers,

    Gregor

    #5735

    Alex
    Felgo Team
    #5736

    GP

    Hi Alex,

    the size of the scene is 320×480 and the size of the game window is 640×960.

     

    Cheers,

    Gregor

    #5737

    Alex
    Felgo Team

    And with a setup like this, there are no clouds?

    GameWindow {
      width: 320
      height: 480
      Scene {
        width: 320
        height: 480
        ParallaxScrollingBackground {
          movementVelocity: Qt.point(20,0)
          ratio: Qt.point(1.0,0.1)
          sourceImage: "../img/game/backgrounds/clouds-sd.png"
        }
      }
    }

     

    #5738

    GP

    With a setup like you mentioned above the clouds appear in low resolutions but are not visible in high resolutions. (problem inverted)

    I’ve also tried the solution from the other thread by adding a -sd2 image (half of the resolution from sd) and overwriting the contentScalingFileSuffixes like this:

    contentScalingFileSuffixes: {
            return  {
                "-sd2": { "scaleThreshold": 0.5, "internalContentScaleFactor": 0.5 },
                "-sd": { "scaleThreshold": 1, "internalContentScaleFactor": 1 },
                "-hd": { "scaleThreshold": 2, "internalContentScaleFactor": 2 },
                "-hd2": { "scaleThreshold": 2.5, "internalContentScaleFactor": 4}
            };
        }

    But this also did not solve the problem.

     

    Cheers

    #5739

    Alex
    Felgo Team

    Are you trying to change the resolutions at runtime? Try changing the width and height of your GameWindow directly in the code to e.g. 768 * 1024 and check if it’s visible there.

    Cheers,
    Alex

    #5741

    GP

    Hi Alex,

    I tried to change the resolution of the GameWindow directly in code but this also did not work for me. The strange thing is when I set the QMLRenderer to true I can see the clouds in every resolution like I expect it but only in the “debug window”.

     

    Cheers

     

    #5742

    Alex
    Felgo Team

    Can you send me your whole code or an example in which you experience the error to support@felgo.com? I am not able to recreate that specific problem.

    Cheers,
    Alex

Viewing 8 posts - 1 through 8 (of 8 total)

RSS feed for this thread

You must be logged in to reply to this topic.