GuavaTexture

Added in 1.0.0-alpha08

public final class GuavaTexture


Summary

Public methods

static final @NonNull ListenableFuture<@NonNull Texture>

Public factory for a Texture, asynchronously loading a preprocessed texture from a Path relative to the application's assets/ folder.

Public methods

createTextureAsync

@MainThread
public static final @NonNull ListenableFuture<@NonNull TexturecreateTextureAsync(@NonNull Session session, @NonNull Path path)

Public factory for a Texture, asynchronously loading a preprocessed texture from a Path relative to the application's assets/ folder.

Currently, only URLs and relative paths from the assets/ directory are supported.

Parameters
@NonNull Session session

The Session to use for loading the Texture.

@NonNull Path path

The Path of the .png texture file to be loaded, relative to the application's assets/ folder.

Returns
@NonNull ListenableFuture<@NonNull Texture>

a ListenableFuture. Listeners will be called on the main thread if Runnable::run is supplied when adding a listener to the ListenableFuture.

Throws
kotlin.IllegalArgumentException

if Path.isAbsolute is true, as this method requires a relative path.