Skip to content

DisplayClickToDismissListener

Overview

A listener that can be added to a Display to (typically) dismiss a UI component after we receive a press. Provide a listener to be called when the Pointer is released. It will be called unless this there is listener cancel/interruption.

@author Jesse Greenberg (PhET Interactive Simulations)

Class DisplayClickToDismissListener

import { DisplayClickToDismissListener } from 'scenerystack/joist';

Constructor

new DisplayClickToDismissListener( listener : SceneryListenerFunction, providedOptions? : DisplayClickToDismissListenerOptions )

Instance Methods

down( event : SceneryEvent )

Part of the scenery Input API.

dispose()

Type DisplayClickToDismissListenerOptions

import type { DisplayClickToDismissListenerOptions } from 'scenerystack/joist';
  • displayedNode?: Node | null
    A Node that should be 'displayed' (visually displayed on a scenery Display) for this listener to be active. If this is null, the listener will always be active.

Source Code

See the source for DisplayClickToDismissListener.ts in the joist repository.