Nana C++ Library  

An open-source C++ framework project
The Programmer's Guide 
nana::gui::animation

Description

The class animation provides an easy way to display an animation or create a animated GUI.

Model of

None

Public base classes

None


Members

animation() The default construction.
void push_back(const frameset&) Inserts frames at the end.
void looped(bool enable) Enables or disables the animation repeating playback.
void play() Plays the animation.
void pause() Pause the animation.
void output(nana::gui::window wd, const nana::point& pos) Outputs the animation to a specifed window and position.

File

nana/gui/animation.hpp

Notes

Note 1.
Using the animation.

#include <nana/gui/wvl.hpp>
#include <nana/gui/animation.hpp>

int main()
{
    using namespace nana::gui;
   
    //Build frames
    frameset fset;
    fset.push_back("a_pic0.bmp");
    fset.push_back("a_pic1.bmp");
    fset.push_back("a_pic2.bmp");

    //A widget to display animation.
    form fm;
    fm.show();

    animation ani;
    ani.push_back(fset);
    ani.output(fm, nana::point());
    ani.looped(true);
    ani.play();

    exec();
}


See also

frameset.


Move to The Nana Programmer's Guide Main Page