Manual/anim

From Hungrysoftware

Contents

Syntax

 anim (spriteBank, frame [, frame [, frame...]]);

Purpose

Creates an animation using the sprites in the spriteBank file. There must be at least one frame specified.

Each frame must be either a number (in which case the sprite will appear for one screen update only) or the return value from the wait function (which can be used to specify that a sprite should appear for longer than one screen update).

Valid values for numerical frame parameters (or the first parameter in a call to the wait function) are:

Negative number outside range
Horizontally flipped sprite number 0 from spriteBank
Negative number in range
Horizontally flipped sprite -frame from spriteBank
Positive number in range
Sprite number frame from spriteBank
Positive number outside range
Nothing

(The range of valid numbers is 0 to the number of sprites in spriteBank minus 1.)

Return value

The return value is the animation which has been created. This can then be used as part of a costume or applied to a character using the animate function.

Example

 animate (ego, anim ('egoPickUp.duc', 0, 1, 2, wait (3, 10), 2, 1));

See also

addCharacter

setCostume

pause

Personal tools