jjANIMATION class JJ2+

A sprite animation consisting of a sequence of frames

One entry of the global animation table jjAnimations: the number of frames, the frame rate and the index of the first frame in jjAnimFrames. Each entry exists only once, so changes a script makes to it last. Converts implicitly to the index of its first frame.

Functions

bool load(const string&in filename, int hotSpotX, int hotSpotY, int coldSpotYOffset = 0, int firstFrameToOverwrite = -1) partially supported
Loads the frames of the animation from an image file
bool save(const string&in filename, const jjPAL&in palette = jjPalette) const partially supported
Saves the frames of the animation as an image file

Operators

jjANIMATION& opAssign(const jjANIMATION&in o) =
Copies another animation into this one
uint opImplConv() const implicit conversion C++
Converts the animation to the index of its first frame in jjAnimFrames

Properties

uint firstFrame C++
The index of the first frame in jjAnimFrames
int16 fps C++
Frame rate of the animation, usually 10
uint16 frameCount C++
Number of frames in the animation

Function documentation

bool jjANIMATION::load(const string&in filename, int hotSpotX, int hotSpotY, int coldSpotYOffset = 0, int firstFrameToOverwrite = -1)

Loads the frames of the animation from an image file

bool jjANIMATION::save(const string&in filename, const jjPAL&in palette = jjPalette) const

Saves the frames of the animation as an image file

Operator documentation

jjANIMATION& jjANIMATION::opAssign(const jjANIMATION&in o) =

Copies another animation into this one

Copies the frame count, the frame rate and the first frame index. The frames themselves aren't copied, both animations then share them.