July 2018
Intermediate to advanced
462 pages
12h 2m
English
To make a ball appear to be bouncing, we need to make it first animate towards the ground, and then from the ground up to the sky. To do so, we will be invoking the setKeyValueAt method of the QPropertyAnimation class three times. The first and second calls to the setKeyValueAt method will make the ball animate from the top to the bottom. The third call to the setKeyValueAt method will make the ball animate from bottom to top. The coordinates in the three setKeyValueAt methods are provided so that the ball bounces in the opposite direction, and not where it came from. The following are the steps to understand how a ball can be animated to appear to be bouncing:
Read now
Unlock full access