diff options
Diffstat (limited to 'src/declarative/items/qsgsprite.cpp')
-rw-r--r-- | src/declarative/items/qsgsprite.cpp | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/src/declarative/items/qsgsprite.cpp b/src/declarative/items/qsgsprite.cpp index 68f2e7827d..afd32a651f 100644 --- a/src/declarative/items/qsgsprite.cpp +++ b/src/declarative/items/qsgsprite.cpp @@ -44,6 +44,79 @@ QT_BEGIN_NAMESPACE +/*! + \qmlclass Sprite QSGSprite + \inqmlmodule QtQuick 2 + \brief The Sprite element represents a sprite animation + +*/ +/*! + \qmlproperty int QtQuick2::Sprite::duration + + Time between frames. +*/ +/*! + \qmlproperty int QtQuick2::Sprite::durationVariation + + The time between frames can vary by up to this amount. + + Default is 0. +*/ + +/*! + \qmlproperty string QtQuick2::Sprite::name + + The name of this sprite, for use in the to property of other sprites. +*/ +/*! + \qmlproperty QVariantMap QtQuick2::Sprite::to + + A list of other sprites and weighted transitions to them, + for example {"a":1, "b":2, "c":0} would specify that one-third should + transition to sprite "a" when this sprite is done, and two-thirds should + transition to sprite "b" when this sprite is done. As the transitions are + chosen randomly, these proportions will not be exact. With "c":0 in the list, + no sprites will randomly transition to "c", but it wll be a valid path if a sprite + goal is set. + + If no list is specified, or the sum of weights in the list is zero, then the sprite + will repeat itself after completing. +*/ +/*! + \qmlproperty int QtQuick2::Sprite::frames + + Number of frames in this sprite. +*/ +/*! + \qmlproperty int QtQuick2::Sprite::frameHeight + + Height of a single frame in this sprite. +*/ +/*! + \qmlproperty int QtQuick2::Sprite::frameWidth + + Width of a single frame in this sprite. +*/ +/*! + \qmlproperty url QtQuick2::Sprite::source + + 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. +*/ + Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged) + Q_PROPERTY(int durationVariation READ durationVariance WRITE setDurationVariance NOTIFY durationVarianceChanged) + Q_PROPERTY(QVariantMap to READ to WRITE setTo NOTIFY toChanged) + Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) + Q_PROPERTY(qreal speedModifiesDuration READ speedModifer WRITE setSpeedModifier NOTIFY speedModifierChanged) + Q_PROPERTY(int frames READ frames WRITE setFrames NOTIFY framesChanged) + Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) + //If frame height or width is not specified, it is assumed to be a single long row of square frames. + //Otherwise, it can be multiple contiguous rows, when one row runs out the next will be used. + Q_PROPERTY(int frameHeight READ frameHeight WRITE setFrameHeight NOTIFY frameHeightChanged) + Q_PROPERTY(int frameWidth READ frameWidth WRITE setFrameWidth NOTIFY frameWidthChanged) + QSGSprite::QSGSprite(QObject *parent) : QSGStochasticState(parent) , m_generatedCount(0) |