class Anim : public Pageable, public Movable

An Anim (animation) is a sprite list (a sequence of drawings) which can be print in a Page (Pageable), can be move and put on or under the Background, can catch a Key (an action on the keyboard)

Inheritance:


Public Methods

Anim(const String& nameFile, int slow, char listSeparator) throw(Exception)
This constructor load the file
Anim(Anim& a) throw()
Use this constructor to copy an animation
virtual ~Anim() throw()
void virtual paint(WindowPipe& windowPipe) throw()
Paints the current Sprite of the animation according to the animation properties
void virtual reinit() throw()
Sets the animation's position to the first Sprite and activate it.
void virtual move(int j, int i) throw()
Moves the animations (all the Sprites of course) to this vertical, horizontal positions.
void virtual getPos(int& j, int& i) const throw()
Vertical, horizontal positions of the animation.
void virtual keyAction(const Key& key) throw()
The animation can catch the Key if you derive this function (and add it to the Keyer
void virtual setOn() throw()
Sets 'on' the Background
void virtual setUppest() throw()
Used when the Anim is also set 'to' ( see setTo() ) : with 'uppest', the Anim will be on all the others
void virtual setTo() throw()
Sets 'to' the Background
void virtual setUnder() throw()
Sets 'under' the Background
void virtual setPalette(const PixelPalette& pal) throw()
Put the palette to this reference, so the pixels will be passed through, and colored
void virtual setColor(Pixel col) throw()
Coloring an animation does not mean changing the pixels values, but means change the way the animation will be painted
void virtual restoreColor() throw()
Undoes the 'setColor' function.
void getSize(int& j, int& i) const throw()
The vertical, horizontal size of the animation.
void revert() throw()
Revert the Sprite sequence. The final Sprite becomes the first.

Protected Fields

List < Sprite * > list
The sequence of the sprite
Tji pos
The vertical, horizontal position of the animation (all the sprites)
Tji decal
The gap to unwedge the animation, it will be painted at pos.j+decal.j,pos.i+decal.i
Tji size
The size of the animation (all the sprites)
Pixel color
The color of the animation (if colored)
bool colored
If colored
bool on
If 'on' the Background
bool to
If 'to' the Background
bool under
If 'under' the Background
const PixelPalette* pal
An anim can be real-time color painted (passing the pixel through a modifiying colors palette)
const bool deleter
Checks if the destructor has to deleted the Sprites (in the list)
bool uppest
Used when the Anim is also set 'to' ( see setTo() ) : with 'uppest', the Anim will be on all the others

Protected Methods

int virtual virtualWalk() throw()
The function to define for pseudo-parallelism

Inherited from Pageable:


Inherited from Walkable:

Public Methods

int walk() throw(Exception)
int getSlow() const throw()
virtual void setSlow(int slow) throw()

Protected Fields

int s
int t
int returnWalk

Inherited from Paintable:


Inherited from Reinitable:


Inherited from Keyable:


Inherited from Activable:

Public Methods

void virtual activate() throw()
void virtual unactivate() throw()
bool virtual isActive() const throw()

Protected Fields

bool active

Inherited from Movable:


Documentation

An Anim (animation) is a sprite list (a sequence of drawings) which can be print in a Page (Pageable), can be move and put on or under the Background, can catch a Key (an action on the keyboard). It's important to watch all the properties of a Pageable class (especially Walkable which simulates parallelism (interlaces steps of the objects)).
List < Sprite * > list
The sequence of the sprite

Tji pos
The vertical, horizontal position of the animation (all the sprites)

Tji decal
The gap to unwedge the animation, it will be painted at pos.j+decal.j,pos.i+decal.i

Tji size
The size of the animation (all the sprites)

Pixel color
The color of the animation (if colored)

bool colored
If colored

bool on
If 'on' the Background. Means : painted relatively of the Background coordinates, but do not respects the default Sprite rules (no pixel printed if in a second level zone) : so, printed every time totaly (if in the screen of course).
See Also:
Coeur

bool to
If 'to' the Background. Means : painted relatively of the upper left corner of the screen (not relatively to the Background coordinates), and do not respects the default Sprite rules (no pixel printed if in a second level zone) : so, printed every time totaly (if in the screen of course).
See Also:
CharacterMot
Trou

bool under
If 'under' the Background. Means : painted in the Background pixel array and not in the screen, directly in the data array !
See Also:
Boue

const PixelPalette* pal
An anim can be real-time color painted (passing the pixel through a modifiying colors palette)
See Also:
Bonhomme

const bool deleter
Checks if the destructor has to deleted the Sprites (in the list). Needed because of optimization : rather than re-create an animation when a new comes, I prefer copy one already constructed - with the 'Anim(Anim& a)' constructor.
See Also:
CaseGestion

bool uppest
Used when the Anim is also set 'to' ( see setTo() ) : with 'uppest', the Anim will be on all the others
See Also:
Trou

int virtual virtualWalk() throw()
The function to define for pseudo-parallelism
See Also:
Walkable

Anim(const String& nameFile, int slow, char listSeparator) throw(Exception)
This constructor load the file. It defines also the 'slow' integer needed for Walkable.
Throws:
Throws various exceptions (unable to open file,etc.)
See Also:
Walkable

Anim(Anim& a) throw()
Use this constructor to copy an animation. It puts the 'deleter' boolean to false.

virtual ~Anim() throw()

void virtual paint(WindowPipe& windowPipe) throw()
Paints the current Sprite of the animation according to the animation properties

void virtual reinit() throw()
Sets the animation's position to the first Sprite and activate it.

void virtual move(int j, int i) throw()
Moves the animations (all the Sprites of course) to this vertical, horizontal positions.

void virtual getPos(int& j, int& i) const throw()
Vertical, horizontal positions of the animation.

void virtual keyAction(const Key& key) throw()
The animation can catch the Key if you derive this function (and add it to the Keyer...)
See Also:
Keyer

void virtual setOn() throw()
Sets 'on' the Background. Means : painted relatively of the Background coordinates, but do not respects the default Sprite rules (no pixel printed if in a second level zone) : so, printed every time totaly (if in the screen of course).
See Also:
Coeur

void virtual setUppest() throw()
Used when the Anim is also set 'to' ( see setTo() ) : with 'uppest', the Anim will be on all the others
See Also:
Trou

void virtual setTo() throw()
Sets 'to' the Background. Means : painted relatively of the upper left corner of the screen (not relatively to the Background coordinates), and do not respects the default Sprite rules (no pixel printed if in a second level zone) : so, printed every time totaly (if in the screen of course).
See Also:
CharacterMot

void virtual setUnder() throw()
Sets 'under' the Background. Means : painted in the Background pixel array and not in the screen, directly in the data array !
See Also:
Boue

void virtual setPalette(const PixelPalette& pal) throw()
Put the palette to this reference, so the pixels will be passed through, and colored. Attention : It is different than 'setColor'.
See Also:
Bonhomme

void virtual setColor(Pixel col) throw()
Coloring an animation does not mean changing the pixels values, but means change the way the animation will be painted. If the animation is 'colored', it will be painted like that : all the black pixels (0 value) will not be painted, all the others will be painted with the color 'col'. Also, will be added a black shadow on the verge of the Sprite.
See Also:
CharacterMot

void virtual restoreColor() throw()
Undoes the 'setColor' function.

void getSize(int& j, int& i) const throw()
The vertical, horizontal size of the animation.

void revert() throw()
Revert the Sprite sequence. The final Sprite becomes the first.


Direct child classes:
LoopAnim
Author:
David FAUTHOUX
See Also:
Page
Background
Key
Keyer
Walkable

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de