Skip to content

RectangularRadioButtonGroup

Overview

RectangularRadioButtonGroup is a group of rectangular radio buttons, in either horizontal or vertical orientation. See sun.ButtonsScreenView for example usage.

@author Aaron Davis (PhET Interactive Simulations) @author Chris Malley (PixelZoom, Inc.)

Class RectangularRadioButtonGroup

import { RectangularRadioButtonGroup } from 'scenerystack/sun';

Constructor

new RectangularRadioButtonGroup( property : PhetioProperty<T>, items : RectangularRadioButtonGroupItem<T>[], providedOptions? : RectangularRadioButtonGroupOptions )

Instance Methods

getButtonForValue( value : T ) : RectangularRadioButton<T>

Find the RectangularRadioButton corresponding to a value. Note that in the scene graph, the button may be nested under other layers, so use caution for coordinate transformations. @param value @returns the corresponding button

dispose()

Type RectangularRadioButtonGroupOptions

import type { RectangularRadioButtonGroupOptions } from 'scenerystack/sun';
  • soundPlayers?: TSoundPlayer[] | null
    Sound generation for the radio buttons. null means to use the defaults. Otherwise, there must be one for each button.
  • labelAlign?: RectangularRadioButtonLabelAlign
    Determines where the optional label appears, relative to the button
  • labelSpacing?: number
    Spacing between the optional label and the button
  • touchAreaXDilation?: number
    Applied to each button, or each button + optional label. This is not handled via radioButtonOptions because we may have an optional label in addition to the button.
  • touchAreaYDilation?: number
  • mouseAreaXDilation?: number
  • mouseAreaYDilation?: number
  • radioButtonOptions?: StrictOmit<RectangularRadioButtonOptions, "soundPlayer" | "touchAreaXDilation" | "touchAreaYDilation" | "mouseAreaXDilation" | "mouseAreaYDilation">
  • & StrictOmit<TrimmedParentOptions, "children">

Source Code

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