ViewRenderable

public class ViewRenderable

Renders a 2D Android view in 3D space by attaching it to a Node with setRenderable(Renderable). By default, the size of the view is 1 meter in the Scene per 250dp in the layout. Use a ViewSizer to control how the size of the view in the Scene is calculated.

future = ViewRenderable.builder().setView(context, R.layout.view).build();
 viewRenderable = future.thenAccept(...);
 

Nested Classes

class ViewRenderable.Builder Factory class for ViewRenderable  
enum ViewRenderable.HorizontalAlignment Controls the horizontal alignment of the ViewRenderable relative to the Node it is attached to. 
enum ViewRenderable.VerticalAlignment Controls the vertical alignment of the ViewRenderable relative to the Node it is attached to. 

Inherited Constants

Inherited Fields

Public Methods

static ViewRenderable.Builder
builder()
Constructs a ViewRenderable
ViewRenderable.HorizontalAlignment
getHorizontalAlignment()
Gets the ViewRenderable.HorizontalAlignment that controls where the ViewRenderable is positioned relative to the Node it is attached to along the x-axis.
ViewSizer
getSizer()
Gets the ViewSizer that controls the size of this ViewRenderable in the Scene.
ViewRenderable.VerticalAlignment
getVerticalAlignment()
Gets the ViewRenderable.VerticalAlignment that controls where the ViewRenderable is positioned relative to the Node it is attached to along the y-axis.
View
getView()
The 2D Android View that is rendered by this ViewRenderable.
ViewRenderable
makeCopy()
Creates a new instance of this ViewRenderable.
void
setHorizontalAlignment(ViewRenderable.HorizontalAlignment horizontalAlignment)
Sets the ViewRenderable.HorizontalAlignment that controls where the ViewRenderable is positioned relative to the Node it is attached to along the x-axis.
void
setSizer(ViewSizer viewSizer)
Sets the ViewSizer that controls the size of this ViewRenderable in the Scene.
void
setVerticalAlignment(ViewRenderable.VerticalAlignment verticalAlignment)
Sets the ViewRenderable.VerticalAlignment that controls where the ViewRenderable is positioned relative to the Node it is attached to along the y-axis.

Inherited Methods

Public Methods

public static ViewRenderable.Builder builder ()

Constructs a ViewRenderable

public ViewRenderable.HorizontalAlignment getHorizontalAlignment ()

Gets the ViewRenderable.HorizontalAlignment that controls where the ViewRenderable is positioned relative to the Node it is attached to along the x-axis. The default is CENTER.

public ViewSizer getSizer ()

Gets the ViewSizer that controls the size of this ViewRenderable in the Scene.

public ViewRenderable.VerticalAlignment getVerticalAlignment ()

Gets the ViewRenderable.VerticalAlignment that controls where the ViewRenderable is positioned relative to the Node it is attached to along the y-axis. The default is BOTTOM.

public View getView ()

The 2D Android View that is rendered by this ViewRenderable.

public ViewRenderable makeCopy ()

Creates a new instance of this ViewRenderable.

The new renderable will have unique copy of all mutable state. All materials referenced by the ViewRenderable will also be instanced. Immutable data will be shared between the instances. The new ViewRenderable will reference the same getFilamentEngine View as the original ViewRenderable.

public void setHorizontalAlignment (ViewRenderable.HorizontalAlignment horizontalAlignment)

Sets the ViewRenderable.HorizontalAlignment that controls where the ViewRenderable is positioned relative to the Node it is attached to along the x-axis. The default is CENTER.

Parameters
horizontalAlignment

public void setSizer (ViewSizer viewSizer)

Sets the ViewSizer that controls the size of this ViewRenderable in the Scene.

Parameters
viewSizer

public void setVerticalAlignment (ViewRenderable.VerticalAlignment verticalAlignment)

Sets the ViewRenderable.VerticalAlignment that controls where the ViewRenderable is positioned relative to the Node it is attached to along the y-axis. The default is BOTTOM.

Parameters
verticalAlignment