Most visited

Recently visited

ViroViewScene

public class ViroViewScene
extends ViroView

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.viro.core.ViroView
           ↳ com.viro.core.ViroViewScene


ViroViewScene is a ViroView for rendering a Scene on a simple Android View.

Summary

Nested classes

enum ViroViewScene.StartupError

Errors returned by the ViroViewScene.StartupListener, in response to Viro failing to initialize. 

interface ViroViewScene.StartupListener

Callback interface for responding to ViroViewScene startup success or failure. 

Public constructors

ViroViewScene(Context context, ViroViewScene.StartupListener startupListener)

Create a new ViroViewScene with the default RendererConfiguration.

ViroViewScene(Context context, ViroViewScene.StartupListener startupListener, RendererConfiguration config)

Create a new ViroViewScene with the given RendererConfiguration, which determines the rendering techniques and rendering fidelity to use for this View.

Public methods

void dispose()

Release native resources associated with this ViroView.

ViroMediaRecorder getRecorder()

Returns a ViroMediaRecorder, which can be used to take screenshots of the Scene or record video.

void setBackgroundColor(int color)

Set the background color of view.

void setScene(Scene scene)

Set the Scene this ViroView should render.

Public constructors

ViroViewScene

ViroViewScene (Context context, 
                ViroViewScene.StartupListener startupListener)

Create a new ViroViewScene with the default RendererConfiguration.

Parameters
context Context: The activity context.

startupListener ViroViewScene.StartupListener: Listener to respond to startup success or failure. Will be notified of any errors encountered while initializing Viro. Optional, may be null.

ViroViewScene

ViroViewScene (Context context, 
                ViroViewScene.StartupListener startupListener, 
                RendererConfiguration config)

Create a new ViroViewScene with the given RendererConfiguration, which determines the rendering techniques and rendering fidelity to use for this View.

Parameters
context Context: The activity context.

startupListener ViroViewScene.StartupListener: Listener to respond to startup success or failure. Will be notified of any errors encountered while initializing Viro. Optional, may be null.

config RendererConfiguration: The RendererConfiguration to use.

Public methods

dispose

void dispose ()

Release native resources associated with this ViroView.

getRecorder

ViroMediaRecorder getRecorder ()

Returns a ViroMediaRecorder, which can be used to take screenshots of the Scene or record video. Currently only the ViroViewARCore supports the media recorder.

Returns
ViroMediaRecorder The ViroMediaRecorder, or null if not supported by the platform.

setBackgroundColor

void setBackgroundColor (int color)

Set the background color of view. This is the color that will be rendered behind the Viro scenegraph.

Parameters
color int: The Color's int value.

setScene

void setScene (Scene scene)

Set the Scene this ViroView should render. ARScene should be used for augmented reality applications.

Parameters
scene Scene: The Scene to render in this ViroView.

Hooray!