Import std.image.animation
std.image.animation
Animations: frames of Images, each shown for a time.
Animation: frames of one size, each an Image shown for its delay, played a number of times or forever, which Gif's and Png's DecodeAnimation give and their EncodeAnimation take.
std/image/animation.fb
Types
Frame
struct
Public Struct Frame
One of an Animation's frames: its image, and how long it's shown, in milliseconds.
Examples
Local frame = Frame(Image(1, 1), 100)
Expect(frame.Delay == 100 && frame.Image.Width == 1)std/image/animation.fb, line 19
-
What the frame shows.
-
How long it's shown, in milliseconds.
Animation
class
Public Class Animation
Frames of one size, each an Image shown for its delay, played a number of times or forever.
Examples
Local blink = Animation(2, 2)
Local on = Image(2, 2)
on.Fill(Color32.White)
blink.Add(on, 500)
blink.Add(Image(2, 2), 500)
Expect(blink.Count == 2 && blink.Plays == 0)
Local gif = Gif.EncodeAnimation(blink)
Local back = Try Gif.DecodeAnimation(gif)
Expect(back.Count == 2 && back[0].Delay == 500)std/image/animation.fb, line 42
-
An animation of frames of
widthbyheightpixels, with no frames, playedplaystimes, or forever for 0. Panics when the size is one an Image can't be, orplaysis negative. -
How many pixels wide its frames are.
-
How many pixels high its frames are.
-
How many times its frames play, or 0 for forever. Panics when it's given a negative one.
-
How many frames it has.
-
Its frames, in the order they play.
-
The frame at index. Panics when it's out of range.
-
Adds a frame of
image, which it keeps rather than copies, so what changes theimagechanges the frame, shown fordelaymilliseconds. Panics when theimageisn't the animation's size, or thedelayis negative or longer than 65535000, APNG's longest, 65535 seconds.
Report an issue with this page or with FutureBlitz on GitHub.