Here it is:
Image {
id: cloudsWHITE
x: 37
y: -59
width: 396
height: 429
source: "../../Desktop/vplayPapi/clouds.png"
MovementAnimation {
id: movClouds
target: parent
property: "pos"
running: false
velocity: Qt.point(0, 60)
}
}
Timer {
id: timerCloud
running: true
repeat: true
onTriggered: {
cloudsWHITE.y = -549;
interval = 5000
if(movClouds.running === false){
interval = 14000;
movClouds.start();
movClouds.running = true
}
else{
interval = 1;
movClouds.stop();
movClouds.running = false;
}
}
}
In this code I repeat the image movement from the top of the window to the bottom.
To have fluent movement (moving background) I wanted to add the same image in the second timer that would start after (14/2=)7 seconds
(the first image needs 14 sec to pass all window). So I set the interval = 7 s. But the timers start working at the same time.
I don’t know if there is any esier way to create moving background, so that’s what I did.
Hopefully it is somehow clear what I wrote 😉