Class Animation

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class Animation
    extends Managed
    • Field Detail

      • _size

        @Internal
        @Nullable
        public @Nullable io.github.humbleui.types.Point _size
    • Constructor Detail

      • Animation

        @Internal
        public Animation​(long ptr)
    • Method Detail

      • makeFromString

        @NotNull
        @Contract("!null -> new; null -> fail")
        public static @NotNull Animation makeFromString​(@NotNull
                                                        @NotNull java.lang.String data)
      • makeFromFile

        @NotNull
        @Contract("!null -> new; null -> fail")
        public static @NotNull Animation makeFromFile​(@NotNull
                                                      @NotNull java.lang.String path)
      • makeFromData

        @NotNull
        @Contract("!null -> new; null -> fail")
        public static @NotNull Animation makeFromData​(@NotNull
                                                      @NotNull Data data)
      • render

        @NotNull
        @Contract("!null -> this; null -> fail")
        public @NotNull Animation render​(@NotNull
                                         @NotNull Canvas canvas)

        Draws the current animation frame

        It is undefined behavior to call render() on a newly created Animation before specifying an initial frame via one of the seek() variants.

        Parameters:
        canvas - destination canvas
        Returns:
        this
      • render

        @NotNull
        @Contract("_, _, _ -> this")
        public @NotNull Animation render​(@NotNull
                                         @NotNull Canvas canvas,
                                         @NotNull
                                         @NotNull io.github.humbleui.types.Point offset)

        Draws the current animation frame

        It is undefined behavior to call render() on a newly created Animation before specifying an initial frame via one of the seek() variants.

        Parameters:
        canvas - destination canvas
        offset - destination offset
        Returns:
        this
      • render

        @NotNull
        @Contract("_, _, _ -> this")
        public @NotNull Animation render​(@NotNull
                                         @NotNull Canvas canvas,
                                         float left,
                                         float top)

        Draws the current animation frame

        It is undefined behavior to call render() on a newly created Animation before specifying an initial frame via one of the seek() variants.

        Parameters:
        canvas - destination canvas
        left - destination offset left
        top - destination offset top
        Returns:
        this
      • render

        @NotNull
        @Contract("_, _, _ -> this")
        public @NotNull Animation render​(@NotNull
                                         @NotNull Canvas canvas,
                                         @NotNull
                                         @NotNull io.github.humbleui.types.Rect dst,
                                         RenderFlag... renderFlags)

        Draws the current animation frame

        It is undefined behavior to call render() on a newly created Animation before specifying an initial frame via one of the seek() variants.

        Parameters:
        canvas - destination canvas
        dst - destination rect
        renderFlags - render flags
        Returns:
        this
      • seek

        @NotNull
        @Contract("_ -> this")
        public @NotNull Animation seek​(float t)

        Updates the animation state for |t|.

        Parameters:
        t - normalized [0..1] frame selector (0 → first frame, 1 → final frame)
        Returns:
        this
      • seek

        @NotNull
        @Contract("_, _ -> this")
        public @NotNull Animation seek​(float t,
                                       @Nullable
                                       @Nullable InvalidationController ic)

        Updates the animation state for |t|.

        Parameters:
        t - normalized [0..1] frame selector (0 → first frame, 1 → final frame)
        ic - invalidation controller (dirty region tracking)
        Returns:
        this
      • seekFrame

        @NotNull
        @Contract("_ -> this")
        public @NotNull Animation seekFrame​(float t)

        Update the animation state to match |t|, specified as a frame index i.e. relative to getDuration() * getFPS().

        Fractional values are allowed and meaningful - e.g. 0.0 → first frame 1.0 → second frame 0.5 → halfway between first and second frame

        Parameters:
        t - frame index
        Returns:
        this
      • seekFrame

        @NotNull
        @Contract("_, _ -> this")
        public @NotNull Animation seekFrame​(float t,
                                            @Nullable
                                            @Nullable InvalidationController ic)

        Update the animation state to match |t|, specified as a frame index i.e. relative to getDuration() * getFPS().

        Fractional values are allowed and meaningful - e.g. 0.0 → first frame 1.0 → second frame 0.5 → halfway between first and second frame

        Parameters:
        t - frame index
        ic - invalidation controller (dirty region tracking)
        Returns:
        this
      • seekFrameTime

        @NotNull
        @Contract("_ -> this")
        public @NotNull Animation seekFrameTime​(float t)

        Update the animation state to match t, specifed in frame time i.e. relative to getDuration().

        Parameters:
        t - frame time
        Returns:
        this
      • seekFrameTime

        @NotNull
        @Contract("_, _ -> this")
        public @NotNull Animation seekFrameTime​(float t,
                                                @Nullable
                                                @Nullable InvalidationController ic)

        Update the animation state to match t, specifed in frame time i.e. relative to getDuration().

        Parameters:
        t - frame time
        ic - invalidation controller (dirty region tracking)
        Returns:
        this
      • getDuration

        public float getDuration()
        Returns:
        the animation duration in seconds
      • getFPS

        public float getFPS()
        Returns:
        the animation frame rate (frames / second)
      • getInPoint

        public float getInPoint()
        Returns:
        Animation in point, in frame index units
      • getOutPoint

        public float getOutPoint()
        Returns:
        Animation out point, in frame index units
      • getVersion

        @NotNull
        public @NotNull java.lang.String getVersion()
      • getSize

        @NotNull
        public @NotNull io.github.humbleui.types.Point getSize()
      • getWidth

        public float getWidth()
      • getHeight

        public float getHeight()
      • _nGetFinalizer

        @Internal
        public static long _nGetFinalizer()
      • _nMakeFromString

        @Internal
        public static long _nMakeFromString​(java.lang.String data)
      • _nMakeFromFile

        @Internal
        public static long _nMakeFromFile​(java.lang.String path)
      • _nMakeFromData

        @Internal
        public static long _nMakeFromData​(long dataPtr)
      • _nRender

        @Internal
        public static void _nRender​(long ptr,
                                    long canvasPtr,
                                    float left,
                                    float top,
                                    float right,
                                    float bottom,
                                    int flags)
      • _nSeek

        @Internal
        public static void _nSeek​(long ptr,
                                  float t,
                                  long icPtr)
      • _nSeekFrame

        @Internal
        public static void _nSeekFrame​(long ptr,
                                       float t,
                                       long icPtr)
      • _nSeekFrameTime

        @Internal
        public static void _nSeekFrameTime​(long ptr,
                                           float t,
                                           long icPtr)
      • _nGetDuration

        @Internal
        public static float _nGetDuration​(long ptr)
      • _nGetFPS

        @Internal
        public static float _nGetFPS​(long ptr)
      • _nGetInPoint

        @Internal
        public static float _nGetInPoint​(long ptr)
      • _nGetOutPoint

        @Internal
        public static float _nGetOutPoint​(long ptr)
      • _nGetVersion

        @Internal
        public static java.lang.String _nGetVersion​(long ptr)
      • _nGetSize

        @Internal
        public static io.github.humbleui.types.Point _nGetSize​(long ptr)