• Sceneform SDK for Android was open sourced and archived (github.com/google-ar/sceneform-android-sdk) with version 1.16.0.
  • This site (developers.google.com/sceneform) serves as the documentation archive for the previous version, Sceneform SDK for Android 1.15.0.
  • Do not use version 1.17.0 of the Sceneform Maven artifacts.
  • The 1.17.1 Maven artifacts can be used. Other than the version, however, the 1.17.1 artifacts are identical to the 1.15.0 artifacts.

Node.OnTouchListener

public static interface Node.OnTouchListener

Interface definition for a callback to be invoked when a touch event is dispatched to this node. The callback will be invoked before onTouchEvent(HitTestResult, MotionEvent) is called.

Public Methods

abstract boolean
onTouch(HitTestResult hitTestResult, MotionEvent motionEvent)
Handles when a touch event has been dispatched to a node.

Public Methods

public abstract boolean onTouch (HitTestResult hitTestResult, MotionEvent motionEvent)

Handles when a touch event has been dispatched to a node.

On ACTION_DOWN events, getNode() will always be this node or one of its children. On other events, the touch may have moved causing the getNode() to change (or possibly be null).

Parameters
hitTestResult represents the node that was touched and information about where it was touched
motionEvent the MotionEvent object containing full information about the event
Returns
  • true if the listener has consumed the event, false otherwise