setSource

open fun setSource(materialBuffer: ByteBuffer): Material.Builder

Allows a Material to be created with data.

Construction will be immediate. Please use setRegistryId to register this material for reuse.

Return

Builder for chaining setup calls

Parameters

materialBuffer

Sets the material data.


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

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

Return

Builder for chaining setup calls

Parameters

context

Sets the Context used for loading the resource

sourceUri

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


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

Allows a Material to be constructed from resource.

Construction will be asynchronous.

Return

Builder for chaining setup calls

Parameters

context

Sets the Context used for loading the resource

resource

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


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

Allows a Material to be constructed via callable function.

Return

Builder for chaining setup calls

Parameters

inputStreamCreator

Supplies an InputStream with the Material data