#include <pixmapsprite.h>
Inheritance diagram for PixmapSprite:
Public Types | |
| enum | AnimationState { Idle, Animated } |
| Possible animation states of the sprite. More... | |
Public Member Functions | |
| PixmapSprite (int advancePeriod, int no, QGraphicsScene *scene) | |
| Constructor for the sprite. | |
| PixmapSprite (QString id, ThemeManager *theme, int advancePeriod, int no, QGraphicsScene *scene) | |
| Constructor for the sprite. | |
| virtual void | advance (int phase) |
| Standard QGI advance function. | |
| virtual int | type () const |
| Retrieve the type of QGI. | |
| int | number () |
| Retrieve the user defined sprite number (i.e. | |
| virtual void | changeTheme () |
| Main theme manager function. | |
| void | setFrame (int no, bool force=false) |
| Choose a pixmap frame of this sprite. | |
| void | setAnimation (int start, int end, int delay) |
| Initalize and start a frame animation between the start and end frame. | |
| void | setAnimation (bool status) |
| Start or stop an animation. | |
| void | setPosition (QPointF pos) |
| Set/Move the sprite to the given position. | |
| double | getDoubleValue (QString item) |
| Reads a theme configuration item of type double and of the given name. | |
Protected Attributes | |
| int | mNo |
| The user defined sprite number. | |
| int | mAdvancePeriod |
| The canvas advance peridod (e.g. | |
| QString | mId |
| The theme id. | |
| AnimationState | mAnimationState |
| The state of the animation. | |
| QPointF | mStart |
| The position of the sprite [rel 0. | |
| int | mStartFrame |
| The first frame in the frame animation. | |
| int | mEndFrame |
| The last frame in the frame animation. | |
| int | mDelay |
| The delay between two frames in the frame animation. | |
| int | mTime |
| The current running time for the animation. | |
| int | mCurrentFrame |
| The current running frame number for the animation. | |
| QList< QPixmap > | mFrames |
| Storage of the frame pixmaps. | |
| QList< QPointF > | mHotspots |
| Storage of the frame pixmap offset points. | |
It can be animated and it is themable.
Definition at line 35 of file pixmapsprite.h.
|
|
Possible animation states of the sprite.
Definition at line 57 of file pixmapsprite.h. |
|
||||||||||||||||
|
Constructor for the sprite.
Definition at line 51 of file pixmapsprite.cpp. References Idle, mAdvancePeriod, mAnimationState, mCurrentFrame, and mNo. Referenced by ScoreSprite::ScoreSprite(). |
|
||||||||||||||||||||||||
|
Constructor for the sprite.
Definition at line 36 of file pixmapsprite.cpp. References Idle, mAdvancePeriod, mAnimationState, mCurrentFrame, mNo, and ThemeManager::updateTheme(). Here is the call graph for this function: |
|
|
Standard QGI advance function.
Reimplemented in ScoreSprite. Definition at line 210 of file pixmapsprite.cpp. References Animated, mAdvancePeriod, mAnimationState, mCurrentFrame, mDelay, mEndFrame, mStartFrame, mTime, and setFrame(). Referenced by ScoreSprite::advance(). Here is the call graph for this function: |
|
|
Main theme manager function. Called when any theme change like a new theme or a theme size change occurs. This object needs to resiez and redraw then. Implements Themable. Reimplemented in ScoreSprite. Definition at line 65 of file pixmapsprite.cpp. References ThemeManager::config(), ThemeManager::getScale(), Themable::getScale(), mFrames, mHotspots, Themable::setScale(), and Themable::thememanager(). Referenced by ScoreSprite::changeTheme(). Here is the call graph for this function: |
|
|
Reads a theme configuration item of type double and of the given name.
Definition at line 160 of file pixmapsprite.cpp. References ThemeManager::config(), and Themable::thememanager(). Here is the call graph for this function: |
|
|
Retrieve the user defined sprite number (i.e. which PixmapSprite)
Definition at line 72 of file pixmapsprite.h. References mNo. |
|
|
Start or stop an animation.
Definition at line 176 of file pixmapsprite.cpp. References Animated, Idle, mAnimationState, mStartFrame, mTime, and setFrame(). Here is the call graph for this function: |
|
||||||||||||||||
|
Initalize and start a frame animation between the start and end frame. The delay between the frames is given in [ms]. After the last frame is displayed the animation starts with the first frame.
Definition at line 186 of file pixmapsprite.cpp. References mDelay, mEndFrame, and mStartFrame. |
|
||||||||||||
|
Choose a pixmap frame of this sprite. If the setting is forced a redraw is even performed when the frame number stays the same. This is important for theme changes.
Definition at line 197 of file pixmapsprite.cpp. References mCurrentFrame, mFrames, and mHotspots. Referenced by advance(), ScoreSprite::changeTheme(), setAnimation(), ScoreSprite::setInput(), and ScoreSprite::setTrump(). |
|
|
Set/Move the sprite to the given position. The position is given in relative coordinates [0..1, 0..1] to its parent object. Thus the position is scaled with the scale from the theme manager.
Definition at line 168 of file pixmapsprite.cpp. References Themable::getScale(), and mStart. Here is the call graph for this function: |
|
|
Retrieve the type of QGI. This item is UserType+3
Reimplemented in ScoreSprite. Definition at line 67 of file pixmapsprite.h. |
|
|
The canvas advance peridod (e.g. 25) [ms] Definition at line 125 of file pixmapsprite.h. Referenced by advance(), and PixmapSprite(). |
|
|
The state of the animation.
Definition at line 133 of file pixmapsprite.h. Referenced by advance(), PixmapSprite(), and setAnimation(). |
|
|
The current running frame number for the animation.
Definition at line 157 of file pixmapsprite.h. Referenced by advance(), PixmapSprite(), and setFrame(). |
|
|
The delay between two frames in the frame animation.
Definition at line 149 of file pixmapsprite.h. Referenced by advance(), and setAnimation(). |
|
|
The last frame in the frame animation.
Definition at line 145 of file pixmapsprite.h. Referenced by advance(), and setAnimation(). |
|
|
Storage of the frame pixmaps.
Definition at line 161 of file pixmapsprite.h. Referenced by changeTheme(), and setFrame(). |
|
|
Storage of the frame pixmap offset points.
Definition at line 165 of file pixmapsprite.h. Referenced by changeTheme(), and setFrame(). |
|
|
The theme id.
Reimplemented from Themable. Definition at line 129 of file pixmapsprite.h. |
|
|
The user defined sprite number.
Definition at line 121 of file pixmapsprite.h. Referenced by number(), and PixmapSprite(). |
|
|
The position of the sprite [rel 0. .1, rel 0..1] Definition at line 137 of file pixmapsprite.h. Referenced by setPosition(). |
|
|
The first frame in the frame animation.
Definition at line 141 of file pixmapsprite.h. Referenced by advance(), and setAnimation(). |
|
|
The current running time for the animation.
Definition at line 153 of file pixmapsprite.h. Referenced by advance(), and setAnimation(). |
1.4.6