Skip to content

ArrowButton

Under Construction

This documentation is auto-generated, and is a work in progress. Please see the source code at https://github.com/phetsims/sun/blob/main/js/buttons/ArrowButton.ts for the most up-to-date information.

Overview

Button with one or more arrows that point up, down, left or right. Press and release immediately and the button fires on 'up'. Press and hold for M milliseconds and the button will fire repeatedly every N milliseconds until released.

@author Chris Malley (PixelZoom, Inc.)

Class ArrowButton

import { ArrowButton } from 'scenerystack/sun';

Constructor

new ArrowButton( direction : ArrowButtonDirection, callback : () => void, providedOptions? : ArrowButtonOptions )

Instance Methods

Type ArrowButtonDirection

import type { ArrowButtonDirection } from 'scenerystack/sun';

"up" | "down" | "left" | "right"

Type ArrowButtonOptions

import type { ArrowButtonOptions } from 'scenerystack/sun';
  • arrowHeight?: number
    from tip to base
  • arrowWidth?: number
    width of base
  • arrowFill?: TPaint
  • arrowStroke?: TPaint
  • arrowLineWidth?: number
  • numberOfArrows?: number
    each arrow will have the same shape and styling
  • arrowSpacing?: number
    spacing for each arrow such that they overlap slightly
  • & StrictOmit<RectangularPushButtonOptions, "content" | "listener">

Source Code

See the source for ArrowButton.ts in the sun repository.