Class ViewRenderable.Builder
- java.lang.Object
-
- com.google.ar.sceneform.rendering.ViewRenderable.Builder
-
- Enclosing class:
- ViewRenderable
public static final class ViewRenderable.Builder extends java.lang.Object
Factory class forViewRenderable
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<ViewRenderable>
build()
Constructs aRenderable
with the parameters of the builder.java.lang.Boolean
hasSource()
True if a source function will be called during buildB
setAnimationFrameRate(int frameRate)
Sets the number of frames per seconds defined in the asset.B
setAsyncLoadEnabled(boolean asyncLoadEnabled)
Enable textures async loading after first rendering.ViewRenderable.Builder
setHorizontalAlignment(ViewRenderable.HorizontalAlignment horizontalAlignment)
Sets theViewRenderable.HorizontalAlignment
that controls where theViewRenderable
is positioned relative to theNode
it is attached to along the x-axis.B
setIsFilamentGltf(boolean isFilamentGltf)
B
setRegistryId(java.lang.Object registryId)
ViewRenderable.Builder
setSizer(ViewSizer viewSizer)
B
setSource(android.content.Context context, int resource)
B
setSource(android.content.Context context, android.net.Uri sourceUri)
B
setSource(android.content.Context context, android.net.Uri sourceUri, boolean enableCaching)
B
setSource(android.content.Context context, java.util.concurrent.Callable<java.io.InputStream> inputStreamCreator)
B
setSource(RenderableDefinition definition)
Build aRenderable
from aRenderableDefinition
.ViewRenderable.Builder
setVerticalAlignment(ViewRenderable.VerticalAlignment verticalAlignment)
Sets theViewRenderable.VerticalAlignment
that controls where theViewRenderable
is positioned relative to theNode
it is attached to along the y-axis.ViewRenderable.Builder
setView(android.content.Context context, int resourceId)
ViewRenderable.Builder
setView(android.content.Context context, android.view.View view)
-
-
-
Method Detail
-
setView
public ViewRenderable.Builder setView(android.content.Context context, android.view.View view)
-
setView
public ViewRenderable.Builder setView(android.content.Context context, int resourceId)
-
setSizer
public ViewRenderable.Builder setSizer(ViewSizer viewSizer)
-
setHorizontalAlignment
public ViewRenderable.Builder setHorizontalAlignment(ViewRenderable.HorizontalAlignment horizontalAlignment)
Sets theViewRenderable.HorizontalAlignment
that controls where theViewRenderable
is positioned relative to theNode
it is attached to along the x-axis. The default isViewRenderable.HorizontalAlignment.CENTER
.
-
setVerticalAlignment
public ViewRenderable.Builder setVerticalAlignment(ViewRenderable.VerticalAlignment verticalAlignment)
Sets theViewRenderable.VerticalAlignment
that controls where theViewRenderable
is positioned relative to theNode
it is attached to along the y-axis. The default isViewRenderable.VerticalAlignment.BOTTOM
.
-
build
public java.util.concurrent.CompletableFuture<ViewRenderable> build()
Constructs aRenderable
with the parameters of the builder.- Returns:
- the constructed
Renderable
-
setSource
public B setSource(android.content.Context context, java.util.concurrent.Callable<java.io.InputStream> inputStreamCreator)
-
setSource
public B setSource(android.content.Context context, android.net.Uri sourceUri)
-
setSource
public B setSource(android.content.Context context, android.net.Uri sourceUri, boolean enableCaching)
-
setSource
public B setSource(android.content.Context context, int resource)
-
setSource
public B setSource(RenderableDefinition definition)
Build aRenderable
from aRenderableDefinition
.
-
setRegistryId
public B setRegistryId(@Nullable java.lang.Object registryId)
-
setIsFilamentGltf
public B setIsFilamentGltf(boolean isFilamentGltf)
-
setAsyncLoadEnabled
public B setAsyncLoadEnabled(boolean asyncLoadEnabled)
Enable textures async loading after first rendering. Default is false.
-
setAnimationFrameRate
public B setAnimationFrameRate(int frameRate)
Sets the number of frames per seconds defined in the asset.- Parameters:
frameRate
- The number of frames during one second
-
hasSource
public java.lang.Boolean hasSource()
True if a source function will be called during build
-
-