Skip to content
FutureBlitz

    Install

    Import std.image.animation

    std.image.animation

    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.

    std/image/animation.fb, line 10

    • Public Field Image: Image field #

      What the frame shows.

    • Public Field Delay: Int field #

      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.

    std/image/animation.fb, line 18

    • @PanicsAtCaller Public New(width: Int, height: Int, plays: Int = 0) constructor #

      An animation of frames of width by height pixels, with none yet, played plays times, or forever for 0. Panics when the size is one an Image can't be, or plays is negative.

    • Public Property Width: Int property #

      How many pixels wide its frames are.

    • Public Property Height: Int property #

      How many pixels high its frames are.

    • @PanicsAtCaller Public Property Plays: Int property #

      How many times its frames play, or 0 for forever. Panics when it's given a negative one.

    • Public Property Count: Int property #

      How many frames it has.

    • Public Property Frames: ReadOnlyArray<Frame> property #

      Its frames, in the order they play.

    • @PanicsAtCaller Operator [](index: Int): Frame operator #

      The frame at index. Panics when it's out of range.

    • @PanicsAtCaller Public Method Add(image: Image, delay: Int) method #

      Adds a frame of image, which it keeps rather than copies, so what changes the image changes the frame, shown for delay milliseconds. Panics when the image isn't the animation's size, or the delay is negative or longer than 65535000, APNG's longest, 65535 seconds.

    Report an issue with this page or with FutureBlitz on GitHub.