Provides basic animation functionality for the GUI.
Provides basic animation functionality for the GUI. There are currently 26 different available animation not all of which are really that impressive or usefull. Animatiions provided by this class are mostly used as transition effects for certain widget, for example for buttons changing from one state to another and so on.
NONE
BLEND
SLIDE_DOWN
SLIDE_UP
SLIDE_LEFT
SLIDE_RIGHT
ROLL_DOWN
ROLL_UP
ROLL_LEFT
ROLL_RIGHT
BLINDS_DOWN
BLINDS_UP
BLINDS_LEFT
BLINDS_RIGHT
OPEN_VERTICAL
OPEN_HORIZONTAL
OPEN_FROM_CENTRE
ROLL_OPEN_VERTICAL
ROLL_OPEN_HORIZONTAL
ROLL_OPEN_FROM_CENTRE
CLOSE_VERTICAL
CLOSE_HORIZONTAL
CLOSE_TO_CENTRE
ROLL_CLOSE_VERTICAL
ROLL_CLOSE_HORIZONTAL
ROLL_CLOSE_TO_CENTRE
ROLL_CLOSE_TO_CENTRE2
Here's a small example:
make a screen bitmap and clear it with lightgray
Bitmap screen;
screen = ::screen;
screen.Clear(Color::lightgray);
make a backbuffer for double buffering and clear it
Bitmap buffer;
buffer.Create(SCREEN_W, SCREEN_H);
buffer.Clear(Color::lightgray);
make a canvas for a nice little "window"
Bitmap canvas;
canvas.CreateSubBitmap(buffer, 100, 20, 120, 60);
now make an animator
Animator anim;
anim.Create(canvas, 500); first create an animated buffer
anim.GetBuffer().Clear(Color::red); draw to the animated buffer
now do the main loop; this should normally be controled by a timer
do {
update the animator
anim.Update();
draw the next frame of animation
anim.Draw(canvas, Animator::BLEND);
do the double buffering bit
buffer.Blit(screen, 0, 0, 0, 0, buffer.w(), buffer.h());
wait for a while
rest(20);
} while (anim.Animating());
Alphabetic index Hierarchy of classes