Woopsi 1.0
GUI Framework for Nintendo DS Homebrew
|
#include <animation.h>
Classes | |
struct | AnimFrame |
Public Types | |
enum | Status { ANIMATION_STATUS_STOPPED = 0, ANIMATION_STATUS_PLAYING = 1, ANIMATION_STATUS_PAUSED = 2 } |
enum | LoopType { ANIMATION_LOOPTYPE_NONE = 0, ANIMATION_LOOPTYPE_LOOP = 1, ANIMATION_LOOPTYPE_PINGPONG = 2 } |
Public Member Functions | |
Animation (const u8 speed, const LoopType loopType, const u16 loops) | |
~Animation () | |
const AnimFrame * | getCurrentFrame () const |
const BitmapBase * | getCurrentBitmap () const |
const Status | getStatus () const |
const u8 | getSpeed () const |
const LoopType | getLoopType () const |
const u16 | getTimeToNextFrame () const |
const u16 | getFrameCount () const |
void | setSpeed (const u8 speed) |
void | setLoopType (const LoopType loopType) |
void | addFrame (const BitmapBase *bitmap, const u8 delay) |
void | run () |
void | play () |
void | stop () |
void | pause () |
void | goToFrame (u16 frame) |
Class for creating sequences of bitmaps.
WoopsiUI::Animation::Animation | ( | const u8 | speed, |
const LoopType | loopType, | ||
const u16 | loops | ||
) |
Constructor.
speed | Default speed of the animation. |
loopType | The loop type used by the animation. |
loops | The number of loops the animation should play through. If this is set to 0, the animation loops infinitely. |
WoopsiUI::Animation::~Animation | ( | ) | [inline] |
Destructor.
void WoopsiUI::Animation::addFrame | ( | const BitmapBase * | bitmap, |
const u8 | delay | ||
) |
Add a new frame to the animation.
bitmap | Pointer to the bitmap to use in the new frame. |
delay | A frame-specific delay to make this frame appear longer than other frames (measured in VBLs). |
const BitmapBase* WoopsiUI::Animation::getCurrentBitmap | ( | ) | const [inline] |
Get the bitmap from the current animation frame.
const AnimFrame* WoopsiUI::Animation::getCurrentFrame | ( | ) | const [inline] |
Get the current animation frame.
const u16 WoopsiUI::Animation::getFrameCount | ( | ) | const [inline] |
Gets the total number of frames in the animation.
const LoopType WoopsiUI::Animation::getLoopType | ( | ) | const [inline] |
Get the animation's loop type.
const u8 WoopsiUI::Animation::getSpeed | ( | ) | const [inline] |
Get the speed of the animation.
const Status WoopsiUI::Animation::getStatus | ( | ) | const [inline] |
Get the current status of the animation - stopped, playing or paused.
const u16 WoopsiUI::Animation::getTimeToNextFrame | ( | ) | const [inline] |
Get the number of VBLs until the next frame is displayed. This includes any delay that the current frame specifies.
void WoopsiUI::Animation::goToFrame | ( | u16 | frame | ) |
Jump to the specified frame.
frame | The frame to jump to. |
void WoopsiUI::Animation::pause | ( | ) | [inline] |
Pause the animation.
void WoopsiUI::Animation::play | ( | ) |
Start the animation.
void WoopsiUI::Animation::run | ( | ) |
Run the animation. Should be called every frame.
void WoopsiUI::Animation::setLoopType | ( | const LoopType | loopType | ) | [inline] |
Set the loop type of the animation.
loopType | The new loop type. |
void WoopsiUI::Animation::setSpeed | ( | const u8 | speed | ) | [inline] |
Set the speed of the animation.
speed | The new speed of the animation. |
void WoopsiUI::Animation::stop | ( | ) |
Stop the animation - does not reset the current frame as doing so will cause the animation to jump back to the first frame when it ends.