What just happened?

We replaced the previous static image with an ever-changing source with a different item. As the Sprite parameter is not an Item element but a data definition of a sprite, we cannot use it in place of the Image element. Instead, we will use the AnimatedSprite element, which is an item that can display a single animated sprite defined inline. It even has the same set of properties as the Sprite parameter. We defined a sprite embedded in images/sprite.png with a width of 80 and a height of 52 pixels. The sprite consists of seven frames that should be displayed at a rate of 10 frames per second. The running property is set up similar to the original Animation element. As the AnimatedSprite element does not have a mirror ...

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.