- 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
Stay organized with collections
Save and categorize content based on your preferences.
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
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-26 UTC."],[[["`Node.OnTouchListener` is an interface used to handle touch events dispatched to a Sceneform node."],["It provides a callback method `onTouch` which is invoked before the node's `onTouchEvent`."],["`onTouch` receives a `HitTestResult` indicating the touched node and a `MotionEvent` with event details."],["Returning `true` from `onTouch` consumes the event, preventing further processing by other listeners or the node itself."]]],["The `Node.OnTouchListener` interface defines a callback for touch events dispatched to a node. It has one method, `onTouch`, which handles these events. `onTouch` receives a `HitTestResult`, indicating the touched node and location, and a `MotionEvent` with event details. On `ACTION_DOWN`, the touched node will always be the current node or a child. The `onTouch` method returns `true` if the event is consumed, or `false` if not.\n"]]