SceneView

public class SceneView
Known Direct Subclasses

A Sceneform SurfaceView that manages rendering and interaction with the scene.

Inherited Constants

Inherited Fields

Public Constructors

SceneView(Context context)
Constructs a SceneView object and binds it to an Android Context.
SceneView(Context context, AttributeSet attrs)
Constructs a SceneView object and binds it to an Android Context.

Public Methods

void
destroy()
Required to exit Sceneform.
void
enableDebug(boolean enable)
If enabled, provides various visualizations for debugging.
Scene
getScene()
Returns the Sceneform Scene created by this view.
boolean
isDebugEnabled()
Indicates whether debugging is enabled for this view.
boolean
onTouchEvent(MotionEvent motionEvent)
void
pause()
Pause Sceneform, which pauses the rendering thread and ARCore session.
void
resume()
Resume Sceneform, which resumes the rendering thread.
void
setBackground(Drawable background)
Set the background to a given Drawable, or remove the background.

Inherited Methods

Public Constructors

public SceneView (Context context)

Constructs a SceneView object and binds it to an Android Context.

Parameters
context the Android Context to use

public SceneView (Context context, AttributeSet attrs)

Constructs a SceneView object and binds it to an Android Context.

Parameters
context the Android Context to use
attrs the Android AttributeSet to associate with

Public Methods

public void destroy ()

Required to exit Sceneform.

Typically called from onDestroy().

public void enableDebug (boolean enable)

If enabled, provides various visualizations for debugging.

Parameters
enable True to enable debugging visualizations, false to disable it.

public Scene getScene ()

Returns the Sceneform Scene created by this view.

public boolean isDebugEnabled ()

Indicates whether debugging is enabled for this view.

public boolean onTouchEvent (MotionEvent motionEvent)

Parameters
motionEvent

public void pause ()

Pause Sceneform, which pauses the rendering thread and ARCore session.

Typically called from onPause().

public void resume ()

Resume Sceneform, which resumes the rendering thread.

Typically called from onResume().

public void setBackground (Drawable background)

Set the background to a given Drawable, or remove the background. If the background is a ColorDrawable, then the background color of the Scene is set to getColor() (the alpha of the color is ignored). Otherwise, default to the behavior of setBackground(Drawable).

Parameters
background

Send feedback about...