-
public final class AssetsKt
-
-
Method Summary
Modifier and Type Method Description final static Result<ImageAsset>rememberImage(CommandQueue commandQueue, ByteArray bytes)WARNING: This function is not yet functional. final static Result<ImageAsset>rememberRegisteredImage(CommandQueue commandQueue, String key, ByteArray bytes)WARNING: This function is not yet functional. final static Result<AudioAsset>rememberAudio(CommandQueue commandQueue, ByteArray bytes)Decode audio from the given bytes on the provided commandQueue. final static Result<AudioAsset>rememberRegisteredAudio(CommandQueue commandQueue, String key, ByteArray bytes)Decode and register audio from the given bytes on the provided commandQueue. final static Result<FontAsset>rememberFont(CommandQueue commandQueue, ByteArray bytes)Decode a font from the given bytes on the provided commandQueue. final static Result<FontAsset>rememberRegisteredFont(CommandQueue commandQueue, String name, ByteArray bytes)Decode and register a font from the given bytes on the provided commandQueue. -
-
Method Detail
-
rememberImage
@Composable() final static Result<ImageAsset> rememberImage(CommandQueue commandQueue, ByteArray bytes)
WARNING: This function is not yet functional. It will be implemented in a future release.
Decode an image from the given bytes on the provided commandQueue. The decoded image can only be used on the same CommandQueue 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:
commandQueue- The command queue 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 commandQueue, String key, ByteArray bytes)
WARNING: This function is not yet functional. It will be implemented in a future release.
Decode and register an image from the given bytes on the provided commandQueue. The decoded image can only be used on the same CommandQueue 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:
commandQueue- The command queue 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 commandQueue, ByteArray bytes)
Decode audio from the given bytes on the provided commandQueue. The decoded audio can only be used on the same CommandQueue 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:
commandQueue- The command queue 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 commandQueue, String key, ByteArray bytes)
Decode and register audio from the given bytes on the provided commandQueue. The decoded audio can only be used on the same CommandQueue 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:
commandQueue- The command queue 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 commandQueue, ByteArray bytes)
Decode a font from the given bytes on the provided commandQueue. The decoded font can only be used on the same CommandQueue 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:
commandQueue- The command queue 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 commandQueue, String name, ByteArray bytes)
Decode and register a font from the given bytes on the provided commandQueue. The decoded font can only be used on the same CommandQueue 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:
commandQueue- The command queue 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.
-
-
-
-