Class ProceduralSpriteAnimationData

A structure that encompasses a procedural animation which can be transformed into a SpriteImage that can be displayed by UI.

NOTE: We can no longer inherit from IAmNotCopyable because RTTI requires us to be copyable.

Hierarchy

  • FrameworkObject
    • ProceduralSpriteAnimationData

Constructors

  • Parses the JSON object into a ProceduralSpriteAnimationData object without reporting parsing errors. If an unskippable error is encountered, an empty object will be returned.

    Parameters

    • jsonObject: JsonObject

      The JSON object to be parsed.

    • OptionalisInternalConstructor: boolean

    Returns ProceduralSpriteAnimationData

    The parsed structure, if it succeeded, else an empty pointer if there were unskippable errors.

Methods

  • Creates a sprite image as an asynchronous operation from the stored animations as a sprite sheet that is laid out horizontally, like in a matrix.

    Parameters

    • frameSize: Immutable<Size2>

      The dimensions of a single frame of the animation.

    • framesPerSecond: number

      The rate at which the animation will be rendered.

    • playbackType: EnumValue<SpriteAnimationPlayback, number>

      What the initial playback type for the sprite should be.

    • OptionaloverrideColor: Immutable<Color>

      An optional color that you can specify to override all colors in the animation, resulting in all shapes using this same color.

    Returns UncertainAsyncOp<ResourceHandle<SpriteImage>, string>

    An async operation, that builds a handle to a sprite image, if it succeeded.

  • Creates a sprite image as an asynchronous operation from the stored animations as a sprite sheet that is laid out horizontally, like in a matrix.

    Parameters

    • frameSize: Immutable<Size2>

      The dimensions of a single frame of the animation.

    • framesPerSecond: number

      The rate at which the animation will be rendered.

    • playbackType: EnumValue<SpriteAnimationPlayback, number>

      What the initial playback type for the sprite should be.

    • OptionaloverrideColor: Immutable<Color>

      An optional color that you can specify to override all colors in the animation, resulting in all shapes using this same color.

    Returns UncertainAsyncOp<SpriteImage, string>

    An async operation, that builds a sprite image pointer, if it succeeded.