AnimatedSprite QML Type
Draws a sprite animation More...
Import Statement: | import QtQuick 2.4 |
Inherits: |
Properties
- currentFrame : int
- frameCount : int
- frameDuration : int
- frameHeight : int
- frameRate : qreal
- frameSync : bool
- frameWidth : int
- frameX : int
- frameY : int
- interpolate : bool
- loops : int
- paused : bool
- reverse : bool
- running : bool
- source : url
Methods
Detailed Description
AnimatedSprite provides rendering and control over animations which are provided 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 Sprite Animations overview. Note that the AnimatedSprite type does not use Sprite types to define multiple animations, but instead encapsulates a single animation itself.
Property Documentation
When paused, the current frame can be advanced manually by setting this property or calling advance().
Number of frames in this AnimatedSprite.
Duration of each frame of the animation. Values equal to or below 0 are invalid.
If frameRate is valid then it will be used to calculate the duration of the frames. If not, and frameDuration is valid, then frameDuration will be used.
Changing this parameter will restart the animation.
Height of a single frame in this AnimatedSprite.
May be omitted if it is the only sprite in the file.
frameRate : qreal |
Frames per second to show in the animation. Values equal to or below 0 are invalid.
If frameRate is valid then it will be used to calculate the duration of the frames. If not, and frameDuration is valid , then frameDuration will be used.
Changing this parameter will restart the animation.
If true, then the animation will have no duration. Instead, the animation will advance one frame each time a frame is rendered to the screen. This synchronizes it with the painting rate as opposed to elapsed time.
If frameSync is set to true, it overrides both frameRate and frameDuration.
Default is false.
Changing this parameter will restart the animation.
Width of a single frame in this AnimatedSprite.
May be omitted if it is the only sprite in the file.
The X coordinate in the image file of the first frame of the AnimatedSprite.
May be omitted if the first frame starts in the upper left corner of the file.
The Y coordinate in the image file of the first frame of the AnimatedSprite.
May be omitted if the first frame starts in the upper left corner of the file.
If true, interpolation will occur between sprite frames to make the animation appear smoother.
Default is true.
After playing the animation this many times, the animation will automatically stop. Negative values are invalid.
If this is set to AnimatedSprite.Infinite the animation will not stop playing on its own.
Default is AnimatedSprite.Infinite
source : url |
The image source for the animation.
If frameHeight and frameWidth are not specified, it is assumed to be a single long row of square frames. Otherwise, it can be multiple contiguous rows or rectangluar frames, when one row runs out the next will be used.
If frameX and frameY are specified, the row of frames will be taken with that x/y coordinate as the upper left corner.
Method Documentation
© 2015 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.