O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

What just happened?

In this section, we just followed the path set for an earlier declaration—the vertical movement of the stellar body influences its perceived size; therefore, it seems like a good decision to bind the two animations together. Note that instead of specifying a new property value source for the scale, we might have modified the original animation and made the scale animation parallel to the animation that operates on the y property:

SequentialAnimation {    ParallelAnimation {        NumberAnimation {            target: sun            property: "y"            from: root.height + sunVisual.height            to: root.height - 270            duration: dayLength / 2            easing.type: Easing.OutCubic        }        NumberAnimation {            target: sun            property: "scale"            from: 1.6; to: 0.8            duration: dayLength / 2 easing.type: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required