VoltAir
|
Graphic based on ImageRenderer which displays a frame animation from a texture sheet. More...
Signals | |
void | pausedChanged () |
Emitted when paused changes. More... | |
void | loopedChanged () |
Emitted when looped changes. More... | |
void | useGameTimeChanged () |
Emitted when useGameTime changes. More... | |
void | frameDelayChanged () |
Emitted when frameDelay changes. More... | |
void | frameCountChanged () |
Emitted when frameCount changes. More... | |
void | animationReachedEnd () |
Emitted when the last frame ends, or the animation has just looped. More... | |
void | pauseWhenHiddenChanged () |
Emitted when pauseWhenHidden changes. More... | |
![]() | |
void | visibleChanged () |
Emitted when visible changes. More... | |
void | sizeScaleChanged () |
Emitted when sizeScale changes. More... | |
void | aspectRatioChanged () |
Emitted when aspectRatio changes. More... | |
void | sourceChanged () |
Emitted when source changes. More... | |
void | cacheRenderParamsChanged () |
Emitted when cacheRenderParams changes. More... | |
void | cullingControlsBodyActiveChanged () |
Emitted when cullingControlsBodyActive changes. More... | |
Public Member Functions | |
AnimatedImageRenderer (QQuickItem *parent=nullptr) | |
Construct a AnimatedImageRenderer. More... | |
bool | isPaused () const |
Returns paused. More... | |
void | setPaused (bool value) |
Sets paused. More... | |
bool | isLooped () const |
Returns looped. More... | |
void | setLooped (bool value) |
Sets looped. More... | |
bool | isUseGameTime () const |
Returns useGameTime. More... | |
void | setUseGameTime (bool value) |
Sets useGameTime. More... | |
float | getFrameDelay () const |
Returns frameDelay. More... | |
void | setFrameDelay (float value) |
Sets frameDelay. More... | |
int | getFrameCount () const |
Returns frameCount. More... | |
void | setFrameCount (int value) |
Sets frameCount. More... | |
int | getCurrentFrame () const |
Returns currentFrame. More... | |
void | setCurrentFrame (int value) |
Sets currentFrame. More... | |
float | getCurrentPosition () const |
Returns currentPosition. More... | |
void | setCurrentPosition (float value) |
Sets currentPosition. More... | |
bool | getPauseWhenHidden () const |
Returns pauseWhenHidden. More... | |
void | setPauseWhenHidden (bool value) |
Sets pauseWhenHidden. More... | |
![]() | |
ImageRenderer (QQuickItem *parent=nullptr) | |
Construct an ImageRenderer. More... | |
bool | isVisible () const |
Returns visible. More... | |
void | setVisible (bool value) |
Sets visible. More... | |
float | getSizeScale () const |
Returns sizeScale. More... | |
void | setSizeScale (float value) |
Sets sizeScale. More... | |
float | getAspectRatio () const |
Returns aspectRatio. More... | |
void | setAspectRatio (float value) |
Sets aspectRatio. More... | |
const QString & | getSource () const |
Returns source. More... | |
void | setSource (const QString &value) |
Sets source. More... | |
bool | getCacheRenderParams () const |
Returns cacheRenderParams. More... | |
void | setCacheRenderParams (bool value) |
Sets cacheRenderParams. More... | |
bool | getCullingControlsBodyActive () const |
Returns cullingControlsBodyActive. More... | |
void | setCullingControlsBodyActive (bool value) |
Sets cullingControlsBodyActive. More... | |
bool | isCulled () const |
Returns whether or not this image has been culled because it is off screen. More... | |
![]() | |
Graphic (QQuickItem *parent=nullptr) | |
Construct a Graphic. More... | |
![]() | |
QQuickItem (QQuickItem *parent) | |
QQuickWindow * | window () const |
QQuickItem * | parentItem () const |
void | setParentItem (QQuickItem *parent) |
void | stackBefore (const QQuickItem *sibling) |
void | stackAfter (const QQuickItem *sibling) |
QRectF | childrenRect () |
QList< QQuickItem * > | childItems () const |
bool | clip () const |
void | setClip (bool) |
QString | state () const |
void | setState (const QString &) |
qreal | baselineOffset () const |
void | setBaselineOffset (qreal) |
qreal | x () const |
qreal | y () const |
void | setX (qreal) |
void | setY (qreal) |
qreal | width () const |
void | setWidth (qreal) |
void | resetWidth () |
void | setImplicitWidth (qreal) |
qreal | implicitWidth () const |
qreal | height () const |
void | setHeight (qreal) |
void | resetHeight () |
void | setImplicitHeight (qreal) |
qreal | implicitHeight () const |
TransformOrigin | transformOrigin () const |
void | setTransformOrigin (TransformOrigin) |
qreal | z () const |
void | setZ (qreal) |
qreal | rotation () const |
void | setRotation (qreal) |
qreal | scale () const |
void | setScale (qreal) |
qreal | opacity () const |
void | setOpacity (qreal) |
bool | isVisible () const |
void | setVisible (bool) |
bool | isEnabled () const |
void | setEnabled (bool) |
bool | smooth () const |
void | setSmooth (bool) |
bool | activeFocusOnTab () const |
void | setActiveFocusOnTab (bool) |
bool | antialiasing () const |
void | setAntialiasing (bool) |
void | resetAntialiasing () |
Flags | flags () const |
void | setFlag (Flag flag, bool enabled) |
void | setFlags (QFlags< QQuickItem::Flag > flags) |
bool | hasActiveFocus () const |
bool | hasFocus () const |
void | setFocus (bool) |
void | setFocus (bool focus, Qt::FocusReason reason) |
bool | isFocusScope () const |
QQuickItem * | scopedFocusItem () const |
Qt::MouseButtons | acceptedMouseButtons () const |
void | setAcceptedMouseButtons (Qt::MouseButtons buttons) |
bool | acceptHoverEvents () const |
void | setAcceptHoverEvents (bool enabled) |
QCursor | cursor () const |
void | setCursor (const QCursor &cursor) |
void | unsetCursor () |
void | grabMouse () |
void | ungrabMouse () |
bool | keepMouseGrab () const |
void | setKeepMouseGrab (bool keep) |
bool | filtersChildMouseEvents () const |
void | setFiltersChildMouseEvents (bool filter) |
void | grabTouchPoints (const QVector< int > &ids) |
void | ungrabTouchPoints () |
bool | keepTouchGrab () const |
void | setKeepTouchGrab (bool keep) |
virtual bool | contains (const QPointF &point) const |
QPointF | mapToItem (const QQuickItem *item, const QPointF &point) const |
QPointF | mapToScene (const QPointF &point) const |
QRectF | mapRectToItem (const QQuickItem *item, const QRectF &rect) const |
QRectF | mapRectToScene (const QRectF &rect) const |
QPointF | mapFromItem (const QQuickItem *item, const QPointF &point) const |
QPointF | mapFromScene (const QPointF &point) const |
QRectF | mapRectFromItem (const QQuickItem *item, const QRectF &rect) const |
QRectF | mapRectFromScene (const QRectF &rect) const |
void | polish () |
void | forceActiveFocus () |
void | forceActiveFocus (Qt::FocusReason reason) |
QQuickItem * | nextItemInFocusChain (bool forward) |
QQuickItem * | childAt (qreal x, qreal y) const |
virtual QVariant | inputMethodQuery (Qt::InputMethodQuery query) const |
virtual bool | isTextureProvider () const |
virtual QSGTextureProvider * | textureProvider () const |
void | update () |
void | windowChanged (QQuickWindow *window) |
![]() | |
QObject (QObject *parent) | |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
virtual const QMetaObject * | metaObject () const |
QString | objectName () const |
void | setObjectName (const QString &name) |
bool | isWidgetType () const |
bool | isWindowType () const |
bool | signalsBlocked () const |
bool | blockSignals (bool block) |
QThread * | thread () const |
void | moveToThread (QThread *targetThread) |
int | startTimer (int interval, Qt::TimerType timerType) |
void | killTimer (int id) |
T | findChild (const QString &name, QFlags< Qt::FindChildOption > options) const |
QList< T > | findChildren (const QString &name, QFlags< Qt::FindChildOption > options) const |
QList< T > | findChildren (const QRegExp ®Exp, QFlags< Qt::FindChildOption > options) const |
QList< T > | findChildren (const QRegularExpression &re, QFlags< Qt::FindChildOption > options) const |
const QObjectList & | children () const |
void | setParent (QObject *parent) |
void | installEventFilter (QObject *filterObj) |
void | removeEventFilter (QObject *obj) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const |
bool | disconnect (const QObject *receiver, const char *method) const |
void | dumpObjectTree () |
void | dumpObjectInfo () |
bool | setProperty (const char *name, const QVariant &value) |
QVariant | property (const char *name) const |
QList< QByteArray > | dynamicPropertyNames () const |
void | destroyed (QObject *obj) |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const |
bool | inherits (const char *className) const |
void | deleteLater () |
![]() | |
virtual void | classBegin ()=0 |
virtual void | componentComplete ()=0 |
Protected Member Functions | |
virtual void | synchronizeForRendering (RenderList *renderList) override |
Synchronize this Graphic for rendering, adding any RenderNodes to renderList , and buffering any data that will be needed on the render thread for rendering. More... | |
virtual void | computeDestTextureSize (QSizeF *textureSize) const override |
Computes the size to treat the source Texture, for purposes of computing destination rectangle size. More... | |
virtual void | computeSourceTextureRect (QRectF *textureSubRect) const override |
Computes the subrectangle within the source Texture to render. More... | |
![]() | |
virtual void | render (RenderNode *node) override |
Renders the associated node. More... | |
virtual void | componentComplete () override |
Post-initialization that checks for the existence of a parent Actor and the parent Actor's Body, caching the results for use in rendering. More... | |
void | markSourceTextureRectDirty () |
Marks the texture rectangle as dirty, making ImageRenderer update. More... | |
![]() | |
void | getFlattenedRenderParameters (RenderParameters *parameters) |
Compute the rendering parameters and transform of this Graphic by moving up the QQuickItem tree and accumulating results. More... | |
![]() | |
virtual bool | event (QEvent *ev) |
bool | isComponentComplete () const |
virtual void | itemChange (ItemChange change, const ItemChangeData &value) |
void | updateInputMethod (Qt::InputMethodQueries queries) |
bool | widthValid () const |
bool | heightValid () const |
virtual void | classBegin () |
virtual void | keyPressEvent (QKeyEvent *event) |
virtual void | keyReleaseEvent (QKeyEvent *event) |
virtual void | inputMethodEvent (QInputMethodEvent *event) |
virtual void | focusInEvent (QFocusEvent *event) |
virtual void | focusOutEvent (QFocusEvent *event) |
virtual void | mousePressEvent (QMouseEvent *event) |
virtual void | mouseMoveEvent (QMouseEvent *event) |
virtual void | mouseReleaseEvent (QMouseEvent *event) |
virtual void | mouseDoubleClickEvent (QMouseEvent *event) |
virtual void | mouseUngrabEvent () |
virtual void | touchUngrabEvent () |
virtual void | wheelEvent (QWheelEvent *event) |
virtual void | touchEvent (QTouchEvent *event) |
virtual void | hoverEnterEvent (QHoverEvent *event) |
virtual void | hoverMoveEvent (QHoverEvent *event) |
virtual void | hoverLeaveEvent (QHoverEvent *event) |
virtual void | dragEnterEvent (QDragEnterEvent *event) |
virtual void | dragMoveEvent (QDragMoveEvent *event) |
virtual void | dragLeaveEvent (QDragLeaveEvent *event) |
virtual void | dropEvent (QDropEvent *event) |
virtual bool | childMouseEventFilter (QQuickItem *item, QEvent *event) |
virtual void | geometryChanged (const QRectF &newGeometry, const QRectF &oldGeometry) |
virtual QSGNode * | updatePaintNode (QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData) |
virtual void | releaseResources () |
virtual void | updatePolish () |
![]() | |
QObject * | sender () const |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
virtual void | childEvent (QChildEvent *event) |
virtual void | customEvent (QEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
Properties | |
bool | paused |
Pause this animation at the current frame. More... | |
bool | looped |
Loop this animation, restarting it at the first frame after the last frame has finished displaying. More... | |
bool | useGameTime |
Animate this image at the speed of the game, pausing when the game is paused. More... | |
float | frameDelay |
Delay between frames, in seconds. More... | |
int | frameCount |
Total number of frames in the texture sheet. More... | |
int | currentFrame |
Index of the current frame, zero being the first frame. More... | |
float | currentPosition |
Seek position into the animation, with 0.0f being the start, and 1.0f being the end. More... | |
bool | pauseWhenHidden |
Don't animate when this image is off screen or visible is false . More... | |
![]() | |
bool | visible |
Override of QQuickItem's visible property to set visibility. More... | |
float | sizeScale |
Width of this image, in world coordinates. More... | |
float | aspectRatio |
Height of this image, as a ratio of the width. More... | |
QString | source |
Path to the source texture. More... | |
bool | cacheRenderParams |
Controls whether or not the position, rotation, opacity, and z-depth are cached on first render, and cached copies are used subsequently. More... | |
bool | cullingControlsBodyActive |
Controls whether or not the Actor's associated Body's Body::active property is linked to this image's visibility. More... | |
![]() | |
parent | |
x | |
y | |
z | |
width | |
height | |
opacity | |
enabled | |
visible | |
state | |
childrenRect | |
baselineOffset | |
clip | |
focus | |
activeFocus | |
activeFocusOnTab | |
rotation | |
scale | |
transformOrigin | |
smooth | |
antialiasing | |
implicitWidth | |
implicitHeight | |
![]() | |
objectName | |
Additional Inherited Members | |
![]() | |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
![]() | |
typedef | Flags |
Graphic based on ImageRenderer which displays a frame animation from a texture sheet.
The texture sheets used by this class contain a vertical strip of equally sized frames, with the top frame being the first frame. These frames are displayed in sequence, with a specified delay (frameDelay) between frames.
This class is used for various animations in the game, including the Orb collectables, and the Portal animations.
|
explicit |
Construct a AnimatedImageRenderer.
parent | Parent item |
|
signal |
Emitted when the last frame ends, or the animation has just looped.
|
overrideprotectedvirtual |
Computes the size to treat the source Texture, for purposes of computing destination rectangle size.
The actual texture size is passed in as textureSize
. The desired texture size should be written back to textureSize
.
textureSize
unmodified. textureSize | Actual texture size, also receiving desired texture size |
Reimplemented from ImageRenderer.
|
overrideprotectedvirtual |
Computes the subrectangle within the source Texture to render.
textureSubRect
initially contains a unit rectangle from (0.0f, 0.0f)
to (1.0f, 1.0f)
. The desired subrectangle should be written to textureSubRect
by this function.
textureSubRect
unmodified. textureSubRect |
Reimplemented from ImageRenderer.
|
signal |
Emitted when frameCount changes.
|
signal |
Emitted when frameDelay changes.
|
inline |
Returns currentFrame.
|
inline |
Returns currentPosition.
|
inline |
Returns frameCount.
|
inline |
Returns frameDelay.
|
inline |
Returns pauseWhenHidden.
|
inline |
Returns looped.
|
inline |
Returns paused.
|
inline |
Returns useGameTime.
|
signal |
Emitted when looped changes.
|
signal |
Emitted when paused changes.
|
signal |
Emitted when pauseWhenHidden changes.
void AnimatedImageRenderer::setCurrentFrame | ( | int | value | ) |
Sets currentFrame.
value | Integer to set currentFrame to |
void AnimatedImageRenderer::setCurrentPosition | ( | float | value | ) |
Sets currentPosition.
value | Float to set currentPosition to |
void AnimatedImageRenderer::setFrameCount | ( | int | value | ) |
Sets frameCount.
value | Integer to set frameCount to |
void AnimatedImageRenderer::setFrameDelay | ( | float | value | ) |
Sets frameDelay.
value | Float to set frameDelay to |
void AnimatedImageRenderer::setLooped | ( | bool | value | ) |
void AnimatedImageRenderer::setPaused | ( | bool | value | ) |
void AnimatedImageRenderer::setPauseWhenHidden | ( | bool | value | ) |
Sets pauseWhenHidden.
value | Float to set pauseWhenHidden to |
void AnimatedImageRenderer::setUseGameTime | ( | bool | value | ) |
Sets useGameTime.
value | Boolean to set useGameTime to |
|
overrideprotectedvirtual |
Synchronize this Graphic for rendering, adding any RenderNodes to renderList
, and buffering any data that will be needed on the render thread for rendering.
renderList | RenderList to add RenderNodes to for rendering in sorted order |
Reimplemented from ImageRenderer.
|
signal |
Emitted when useGameTime changes.
|
readwrite |
Index of the current frame, zero being the first frame.
|
readwrite |
Seek position into the animation, with 0.0f
being the start, and 1.0f
being the end.
|
readwrite |
Total number of frames in the texture sheet.
|
readwrite |
Delay between frames, in seconds.
|
readwrite |
Loop this animation, restarting it at the first frame after the last frame has finished displaying.
|
readwrite |
Pause this animation at the current frame.
|
readwrite |
Don't animate when this image is off screen or visible is false
.
This reduces the amount of CPU used, but means it isn't completely in step with game time.
|
readwrite |
Animate this image at the speed of the game, pausing when the game is paused.