#include <effect.h>
Inheritance diagram for Effect:
Effect
is some form of animation happening on the screen.
They usually operate in a restricted area of the screen and should not affect the rest. Effects are given a time limit, and they should do everything possible to stay within that.
Effects should execute when their run()
method is invoked. If an effect requires parameters it should define a function called param()
to take them.
Most effects do some sort of initialization in run()
and then call Effect::animate()
to control the timing.
Public Member Functions | |
virtual void | run ()=0 |
Runs the effect. | |
int | get_time () const |
Gets the time limit, in milliseconds. | |
void | set_time (int maxtime) |
Sets the time limit, in milliseconds. | |
int | get_fps () const |
Gets the frame rate used by animate() . | |
void | set_fps (int fps) |
Sets the frame rate used by animate() . | |
Protected Member Functions | |
void | animate (int from, int to, int maxtime=0) |
Performs an animation by calling the step member function with values between first and last . | |
virtual void | step (int value)=0 |
A callback method that's called by animate() every frame. | |
Protected Attributes | |
int | _maxtime |
int | _fps |
int | _oldval |
|
Performs an animation by calling the
It will do its best to stay within |
|
Runs the effect.
It takes no parameters because it should be possible to run an effect without knowing its type, only knowing how long it will take. It should be possible to call Implemented in Effect_move_animation, Effect_move, Effect_fade, Effect_tile, Effect_counter, and Effect_movebars. |
|
A callback method that's called by
That means it shouldn't take long to execute. Before Implemented in Effect_move_animation, Effect_move, Effect_fade, Effect_tile, Effect_counter, and Effect_movebars. |