What just happened?

An animation was attached to the color property of our rectangle modeling the visual aspects of the sun. The animation consists of three parts. First, we perform a transition from red to yellow using the ColorAnimation object. This is an Animation subtype dedicated to modifying colors. Since the rectangle color is not a number, using the NumberAnimation object will not work, as the type cannot interpolate color values. Therefore, we either have to use the PropertyAnimation or the ColorAnimation object. The duration for the animation is set to 20 percent of half the day length so that the yellow color is obtained very quickly. The second component is a PauseAnimation object to provide a delay before the third component ...

Get Game Programming using Qt 5 Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.