17 #ifndef ANIMATEDIMAGERENDERER_H
18 #define ANIMATEDIMAGERENDERER_H
20 #include "ImageRenderer.h"
192 void moveCurrentFrame(
int frame);
193 void updateAnimation();
195 bool mPaused =
false;
197 bool mUseGameTime =
true;
198 bool mPauseWhenHidden =
false;
200 float mFrameDelay = 0.0f;
202 float mNormalizedInvFrameCount = 1.0f;
203 float mFrameTimer = 0.0f;
204 int mCurrentFrame = 0;
205 float mCurrentPosition = 0.0f;
208 #endif // ANIMATEDIMAGERENDERER_H
int getCurrentFrame() const
Returns currentFrame.
Definition: AnimatedImageRenderer.h:131
void setFrameDelay(float value)
Sets frameDelay.
void useGameTimeChanged()
Emitted when useGameTime changes.
virtual void synchronizeForRendering(RenderList *renderList) override
Synchronize this Graphic for rendering, adding any RenderNodes to renderList, and buffering any data ...
bool pauseWhenHidden
Don't animate when this image is off screen or visible is false.
Definition: AnimatedImageRenderer.h:74
void setPauseWhenHidden(bool value)
Sets pauseWhenHidden.
Graphic based on ImageRenderer which displays a frame animation from a texture sheet.
Definition: AnimatedImageRenderer.h:36
int getFrameCount() const
Returns frameCount.
Definition: AnimatedImageRenderer.h:122
void setLooped(bool value)
Sets looped.
bool isPaused() const
Returns paused.
Definition: AnimatedImageRenderer.h:86
int currentFrame
Index of the current frame, zero being the first frame.
Definition: AnimatedImageRenderer.h:62
void loopedChanged()
Emitted when looped changes.
void setUseGameTime(bool value)
Sets useGameTime.
bool isLooped() const
Returns looped.
Definition: AnimatedImageRenderer.h:95
bool isUseGameTime() const
Returns useGameTime.
Definition: AnimatedImageRenderer.h:104
void pauseWhenHiddenChanged()
Emitted when pauseWhenHidden changes.
bool paused
Pause this animation at the current frame.
Definition: AnimatedImageRenderer.h:41
int frameCount
Total number of frames in the texture sheet.
Definition: AnimatedImageRenderer.h:58
float getCurrentPosition() const
Returns currentPosition.
Definition: AnimatedImageRenderer.h:140
void setPaused(bool value)
Sets paused.
virtual void computeSourceTextureRect(QRectF *textureSubRect) const override
Computes the subrectangle within the source Texture to render.
float frameDelay
Delay between frames, in seconds.
Definition: AnimatedImageRenderer.h:54
bool getPauseWhenHidden() const
Returns pauseWhenHidden.
Definition: AnimatedImageRenderer.h:149
void frameCountChanged()
Emitted when frameCount changes.
void frameDelayChanged()
Emitted when frameDelay changes.
float getFrameDelay() const
Returns frameDelay.
Definition: AnimatedImageRenderer.h:113
virtual void computeDestTextureSize(QSizeF *textureSize) const override
Computes the size to treat the source Texture, for purposes of computing destination rectangle size...
void animationReachedEnd()
Emitted when the last frame ends, or the animation has just looped.
bool useGameTime
Animate this image at the speed of the game, pausing when the game is paused.
Definition: AnimatedImageRenderer.h:50
List of RenderNodes, sorted by z-depth for rendering.
Definition: RenderList.h:36
Graphic which displays a texture as an image.
Definition: ImageRenderer.h:38
void setCurrentPosition(float value)
Sets currentPosition.
bool looped
Loop this animation, restarting it at the first frame after the last frame has finished displaying...
Definition: AnimatedImageRenderer.h:46
void setCurrentFrame(int value)
Sets currentFrame.
float currentPosition
Seek position into the animation, with 0.0f being the start, and 1.0f being the end.
Definition: AnimatedImageRenderer.h:67
void setFrameCount(int value)
Sets frameCount.
void pausedChanged()
Emitted when paused changes.