Whenever I try using a ParallaxScrollingBackground item, the background ends up being offset. Here is my code for a static background.
GameWindow {
width: 480
height: 320
Scene {
width: 480
height: 320
MultiResolutionImage{
source: "img/startBackground-sd.png"
anchors.centerIn: parent
}
}
}
Which outputs https://i.imgur.com/K0nxgMO.png which is correct.
Now when I change code to
GameWindow {
width: 480
height: 320
Scene {
width: 480
height: 320
ParallaxScrollingBackground{
sourceImage: "img/startBackground-sd.png"
anchors.centerIn: parent
mirrorSecondImage: false
movementVelocity: Qt.point(-75, 0)
}
}
}
It outputs https://i.imgur.com/sAoeAmT.png
Removing the
anchors.centerIn: parent
yields https://i.imgur.com/2wzGnz7.png which is offset by a bit for some reason. The blue area is the safe zone and the green is the 16:9 and 4:3 zone.
It seems like it should be a simple fix but I just can’t get it to work correctly.
-
This topic was modified 9 years, 7 months ago by
Nuggetslug.
-
This topic was modified 9 years, 7 months ago by
Nuggetslug.