- animation ->initialise: file=[source_sink]
- Load all frames of the image file. A file is searched for in
image
.path,
as for image->initialise.
The format is found from the data, not the name of the file. Fails with
a message if the file cannot be read or is not an image. Without a file,
the animation has no frames: use animation->append
or animation->record
to add them.
- animation ->append: image=image,
delay=[int]
- Append a copy of the image as a frame that is shown for delay
milliseconds (default 100). The first frame sets animation
<-size;
images of another size are scaled to it.
- animation ->clear:
- Remove all frames.
- animation ->record: from=frame
|window,
interval=[real] - Append from
<-image as a frame now and
every interval seconds (default 0.1) until animation->stop,
or until from is destroyed. Each frame is shown for the
interval.
- animation ->stop:
- Stop recording.
- animation ->save: in=file,
format=[{png,gif,webp,avif,ani}], quality=[0..100]
- Save the frames as an animated image file.
png writes an
animated PNG (APNG). If format is omitted, the extension of
the file selects it. quality is used by WebP and AVIF. animation<-loop_count
and the texts such as animation<-title
are saved with the frames, as far as the format can hold them. Fails
with a message if there are no frames or the format cannot be written:
whether WebP and AVIF are available depends on how SDL_image was built.