Load multiple images and add then behind each other to create a simple animation or even a movie. More...
#include <AnimatedPicture.hpp>
Public Member Functions | |
AnimatedPicture () | |
Default constructor. More... | |
AnimatedPicture (const AnimatedPicture ©) | |
Copy constructor. More... | |
virtual | ~AnimatedPicture () |
Destructor. More... | |
AnimatedPicture & | operator= (const AnimatedPicture &right) |
Overload of assignment operator. More... | |
virtual unsigned int | addFrame (const std::string &filename, sf::Time frameDurarion=sf::Time()) |
Load another image/frame from a file. More... | |
virtual void | setSize (float width, float height) |
Changes the size of the displayed image. More... | |
virtual Vector2u | getSize () const |
Returns the size of the first frame, unaffected by scaling. More... | |
virtual Vector2f | getScaledSize () const |
Returns the size of the first frame, after the scaling tranformations. More... | |
virtual void | play () |
Starts or resumes playing the animation. More... | |
virtual void | pause () |
Pauses the animation. More... | |
virtual void | stop () |
Stops the animation. More... | |
virtual void | setFrame (unsigned int frame) |
Sets the animation at a specific frame. More... | |
virtual unsigned int | getCurrentFrame () const |
Returns the current displayed frame. More... | |
virtual void | setFrameDuration (unsigned int frame, sf::Time frameDuration=sf::Time()) |
Changes the amount of time that the frame will be displayed on the screen. More... | |
virtual sf::Time | getCurrentFrameDuration () const |
Returns the duration of the currently displayed frame. More... | |
virtual unsigned int | getFrames () const |
Returns the amount of frames in the animation. More... | |
virtual std::vector< std::string > | getLoadedFilenames () const |
Returns the filenames that were used to load the pictures. More... | |
virtual void | removeFrame (unsigned int frame) |
Removes a frame from the animation. More... | |
virtual void | removeAllFrames () |
Remove all frames from the animation. More... | |
Public Member Functions inherited from tgui::OBJECT | |
OBJECT () | |
Default constructor. More... | |
OBJECT (const OBJECT ©) | |
Copy constructor. More... | |
virtual | ~OBJECT () |
Destructor. More... | |
OBJECT & | operator= (const OBJECT &right) |
Overload of assignment operator. More... | |
virtual void | show () |
Shows the object. More... | |
virtual void | hide () |
Hides the object. More... | |
virtual bool | isVisible () const |
Returns true when the object is visible. More... | |
virtual void | enable () |
Enables the object. More... | |
virtual void | disable () |
Disables the object. More... | |
virtual bool | isEnabled () const |
Returns true when the object is enabled. More... | |
virtual bool | isDisabled () const |
Returns true when the object is disabled. More... | |
virtual bool | isLoaded () const |
Returns true when the object is loaded successfully. More... | |
void | focus () |
Focus the object. More... | |
void | unfocus () |
Unfocus the object. More... | |
void | focusNextObject () |
Focuses the next object. More... | |
virtual bool | isFocused () const |
Returns true when the object is focused and false otherwise. More... | |
virtual ObjectTypes | getObjectType () const |
Returns the type of the object. More... | |
virtual void | moveToFront () |
Places the object before all other objects. More... | |
virtual void | moveToBack () |
Places the object behind all other objects. More... | |
Load multiple images and add then behind each other to create a simple animation or even a movie.
tgui::AnimatedPicture::AnimatedPicture | ( | ) |
Default constructor.
tgui::AnimatedPicture::AnimatedPicture | ( | const AnimatedPicture & | copy | ) |
Copy constructor.
|
virtual |
Destructor.
|
virtual |
Load another image/frame from a file.
All frames should have the same size. The size of the first frame is always used in the calculations.
filename | The filename of the image that you want to use as next frame. |
frameDuration | The amount of time that the frame will be displayed on the screen. When the duration is 0 (default) then the animation will be blocked at that frame. |
|
virtual |
Returns the current displayed frame.
This function will return 0 when no frames have been loaded.
|
virtual |
Returns the duration of the currently displayed frame.
This function will return 0 when no frames have been loaded.
|
virtual |
Returns the amount of frames in the animation.
|
virtual |
Returns the filenames that were used to load the pictures.
When no picture has been loaded yet then this function will return an empty vector.
|
virtual |
Returns the size of the first frame, after the scaling tranformations.
Implements tgui::OBJECT.
|
virtual |
Returns the size of the first frame, unaffected by scaling.
Implements tgui::OBJECT.
AnimatedPicture& tgui::AnimatedPicture::operator= | ( | const AnimatedPicture & | right | ) |
Overload of assignment operator.
|
virtual |
|
virtual |
|
virtual |
Remove all frames from the animation.
|
virtual |
Removes a frame from the animation.
Both 0 and 1 will remove the first frame. When frame is bigger than the amount of frames then the last frame will be removed.
|
virtual |
Sets the animation at a specific frame.
When there are less frames than frame, the last frame will be displayed. Both 0 and 1 will set the first frame.
|
virtual |
Changes the amount of time that the frame will be displayed on the screen.
frame | The frame that is going to have the given duration. Both 0 and 1 will affect the first frame. When frame is bigger than the amount of frames then the last frame will be changed. |
frameDuration | The amount of time that the frame will be displayed on the screen. When the duration is 0 (default) then the animation will be blocked at that frame. |
|
virtual |
Changes the size of the displayed image.
All frames should have the same size. The scaling factors used to get the first frame to the correct size, will also be used for the other frames.
This function can only be called after the first frame is loaded.
Implements tgui::OBJECT.
|
virtual |