Jazz2::Scripting::Legacy::jjANIMATION class

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.

Public static functions

static auto get_jjAnimations(std::uint32_t index) -> jjANIMATION*
Returns the animation at a global index.

Constructors, destructors, conversion operators

jjANIMATION(std::uint32_t index) explicit
Creates a new instance, the entry at the given index of the animation table.
~jjANIMATION()

Public functions

void AddRef()
Increments the reference count.
void Release()
Decrements the reference count.
auto operator=(const jjANIMATION& o) -> jjANIMATION&
Copies another animation into this one.
auto save(const String& filename, const jjPAL& palette) const -> bool partially supported
Saves the frames of the animation as an image file.
auto load(const String& filename, std::int32_t hotSpotX, std::int32_t hotSpotY, std::int32_t coldSpotYOffset, std::int32_t firstFrameToOverwrite) -> bool partially supported
Loads the frames of the animation from an image file.
auto get_firstFrame() const -> std::uint32_t
Returns the index of the first frame in jjAnimFrames.
auto set_firstFrame(std::uint32_t index) -> std::uint32_t
Sets the index of the first frame in jjAnimFrames.
auto getAnimFirstFrame() -> std::uint32_t
Converts the animation to the index of its first frame in jjAnimFrames.

Public variables

std::uint16_t frameCount
Number of frames in the animation.
std::int16_t fps
Frame rate of the animation, usually 10.

Function documentation

static jjANIMATION* Jazz2::Scripting::Legacy::jjANIMATION::get_jjAnimations(std::uint32_t index)

Returns the animation at a global index.

The animations of a set start at jjANIMSET::firstAnim.

jjANIMATION& Jazz2::Scripting::Legacy::jjANIMATION::operator=(const jjANIMATION& 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.

bool Jazz2::Scripting::Legacy::jjANIMATION::save(const String& filename, const jjPAL& palette) const

Saves the frames of the animation as an image file.

bool Jazz2::Scripting::Legacy::jjANIMATION::load(const String& filename, std::int32_t hotSpotX, std::int32_t hotSpotY, std::int32_t coldSpotYOffset, std::int32_t firstFrameToOverwrite)

Loads the frames of the animation from an image file.