setSource

open fun setSource(context: Context, sourceUri: Uri): Texture.Builder

Allows a Texture to be constructed from Uri. Construction will be asynchronous.

Return

Builder for chaining setup calls.

Parameters

sourceUri

Sets a remote Uri or android resource Uri. The texture will be added to the registry using the Uri A previously registered texture with the same Uri will be re-used.

context

Sets the Context used to resolve sourceUri


open fun setSource(inputStreamCreator: Callable<InputStream>): Texture.Builder

Allows a Texture to be constructed via callable function.

Return

Builder for chaining setup calls.

Parameters

inputStreamCreator

Supplies an InputStream with the Texture data.


open fun setSource(context: Context, resource: Int): Texture.Builder

Allows a Texture to be constructed from resource. Construction will be asynchronous.

Return

Builder for chaining setup calls.

Parameters

resource

an android resource with raw type. A previously registered texture with the same resource id will be re-used.

context

Context used for resolution


open fun setSource(bitmap: Bitmap): Texture.Builder

Allows a Texture to be constructed from a Bitmap. Construction will be immediate.

The Bitmap must meet the following conditions to be used by Sceneform:

Parameters

bitmap

Bitmap source of texture data

Throws

if the bitmap isn't valid