Skip to content

Picker

Overview

Sub-component of a Node that handles pickability and hit testing.

A "listener equivalent" is either the existence of at least one input listener, or pickable:true. Nodes with listener equivalents will basically try to hit-test ALL descendants that aren't invisible or pickable:false.

@author Jonathan Olson <jonathan.olson@colorado.edu>

Class Picker

import { Picker } from 'scenerystack/scenery';

Constructor

new Picker( node : Node )

Instance Methods

hitTest( point : Vector2, useMouse : boolean, useTouch : boolean ) : Trail | null

Return a trail to the top node (if any, otherwise null) whose self-rendered area contains the point (in parent coordinates).

@param point @param useMouse - Whether mouse-specific customizations (and acceleration) applies @param useTouch - Whether touch-specific customizations (and acceleration) applies

isPotentiallyPickable() : boolean

Returns whether our node is potentially pickable from its parents (i.e. whether it could be hit-tested and sent input events, and thus whether its input listeners are relevant and could be interrupted).

Source Code

See the source for Picker.ts in the scenery repository.