Package 

Class AssetsKt

    • Method Detail

      • rememberImage

        @Composable() final static Result<ImageAsset> rememberImage(CommandQueue riveWorker, ByteArray bytes)

        Decode an image from the given bytes on the provided RiveWorker. The decoded image can only be used on the same RiveWorker it was created on.

        This function is intended for use with images that may want to be registered multiple times with ImageAsset.register. If you want to decode and register in one step, use rememberRegisteredImage instead.

        The image will be deleted when the composable leaves the composition.

        Parameters:
        riveWorker - The Rive worker that owns and performs operations on this image.
        bytes - The byte array containing the image data to decode.
      • rememberRegisteredImage

        @Composable() final static Result<ImageAsset> rememberRegisteredImage(CommandQueue riveWorker, String key, ByteArray bytes)

        Decode and register an image from the given bytes on the provided RiveWorker. The decoded image can only be used on the same RiveWorker it was created on.

        This function is intended for use with images that are registered once, as a convenience. If you want to register multiple times, use rememberImage and ImageAsset.register instead.

        The image will be deleted and unregistered when the composable leaves the composition.

        Parameters:
        riveWorker - The Rive worker that owns and performs operations on this image.
        key - The key of the referenced image.
        bytes - The byte array containing the image data to decode.
      • rememberAudio

        @Composable() final static Result<AudioAsset> rememberAudio(CommandQueue riveWorker, ByteArray bytes)

        Decode audio from the given bytes on the provided RiveWorker. The decoded audio can only be used on the same RiveWorker it was created on.

        This function is intended for use with audio that may want to be registered multiple times with AudioAsset.register. If you want to decode and register in one step, use rememberRegisteredAudio instead.

        The audio will be deleted when the composable leaves the composition.

        Parameters:
        riveWorker - The Rive worker that owns and performs operations on this audio.
        bytes - The byte array containing the audio data to decode.
      • rememberRegisteredAudio

        @Composable() final static Result<AudioAsset> rememberRegisteredAudio(CommandQueue riveWorker, String key, ByteArray bytes)

        Decode and register audio from the given bytes on the provided riveWorker. The decoded audio can only be used on the same RiveWorker it was created on.

        This function is intended for use with audio that is registered once, as a convenience. If you want to register multiple times, use rememberAudio and AudioAsset.register instead.

        The audio will be deleted and unregistered when the composable leaves the composition.

        Parameters:
        riveWorker - The Rive worker that owns and performs operations on this audio.
        key - The key of the referenced audio.
        bytes - The byte array containing the audio data to decode.
      • rememberFont

        @Composable() final static Result<FontAsset> rememberFont(CommandQueue riveWorker, ByteArray bytes)

        Decode a font from the given bytes on the provided RiveWorker. The decoded font can only be used on the same RiveWorker it was created on.

        This function is intended for use with fonts that may want to be registered multiple times with FontAsset.register. If you want to decode and register in one step, use rememberRegisteredFont instead.

        The font will be deleted when the composable leaves the composition.

        Parameters:
        riveWorker - The Rive worker that owns and performs operations on this font.
        bytes - The byte array containing the font data to decode.
      • rememberRegisteredFont

        @Composable() final static Result<FontAsset> rememberRegisteredFont(CommandQueue riveWorker, String name, ByteArray bytes)

        Decode and register a font from the given bytes on the provided RiveWorker. The decoded font can only be used on the same RiveWorker it was created on.

        This function is intended for use with fonts that are registered once, as a convenience. If you want to register multiple times, use rememberFont and FontAsset.register instead.

        The font will be deleted and unregistered when the composable leaves the composition.

        Parameters:
        riveWorker - The Rive worker that owns and performs operations on this font.
        name - The name of the referenced font.
        bytes - The byte array containing the font data to decode.