aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickanimatedsprite.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-03-03 01:00:13 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-03-03 01:00:13 +0100
commitbf0603fd03ade413036c7dba1ffe0e7ac9364fc9 (patch)
treeb6329f629c5c0a19ca419671ee328725daec699f /src/quick/items/qquickanimatedsprite.cpp
parentbb7a5d0cb6e62fa411e8b66759bf6b798c3f68d9 (diff)
parent6b310e5f9a53c366fbb8fb78bd7c343aad4e0cdd (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Diffstat (limited to 'src/quick/items/qquickanimatedsprite.cpp')
-rw-r--r--src/quick/items/qquickanimatedsprite.cpp64
1 files changed, 61 insertions, 3 deletions
diff --git a/src/quick/items/qquickanimatedsprite.cpp b/src/quick/items/qquickanimatedsprite.cpp
index 5234ee65cb..c5d36297a4 100644
--- a/src/quick/items/qquickanimatedsprite.cpp
+++ b/src/quick/items/qquickanimatedsprite.cpp
@@ -69,9 +69,67 @@ QT_BEGIN_NAMESPACE
as multiple frames in the same image file. You can play it at a fixed speed, at the
frame rate of your display, or manually advance and control the progress.
- For details of how a sprite animation is defined see the \l{Sprite Animations} overview.
- Note that the AnimatedSprite type does not use Sprite types to define multiple animations,
- but instead encapsulates a single animation itself.
+ Consider the following sprite sheet:
+
+ \image animatedsprite-loading.png
+
+ It can be divided up into four frames:
+
+ \image animatedsprite-loading-frames.png
+
+ To play each of these frames at a speed of 500 milliseconds per frame, the
+ following code can be used:
+
+ \table
+ \header
+ \li Code
+ \li Result
+ \row
+ \li
+ \code
+ AnimatedSprite {
+ source: "loading.png"
+ frameWidth: 64
+ frameHeight: 64
+ frameCount: 4
+ frameDuration: 500
+ }
+ \endcode
+ \li
+ \image animatedsprite-loading-interpolated.gif
+ \endtable
+
+ By default, the frames are interpolated (blended together) to make the
+ animation appear smoother. To disable this, set \l interpolate to \c false:
+
+ \table
+ \header
+ \li Code
+ \li Result
+ \row
+ \li
+ \code
+ AnimatedSprite {
+ source: "loading.png"
+ frameWidth: 64
+ frameHeight: 64
+ frameCount: 4
+ frameDuration: 500
+ interpolate: false
+ }
+ \endcode
+ \li
+ \image animatedsprite-loading.gif
+ \endtable
+
+ To control how AnimatedSprite responds to being scaled, use the
+ \l {Item::}{smooth} property.
+
+ Note that unlike \l SpriteSequence, the AnimatedSprite type does not use
+ \l Sprite to define multiple animations, but instead encapsulates a
+ single animation itself.
+
+ \sa {Sprite Animations}
*/
/*!