NumberEntryControl¶
Overview¶
A composite Scenery node that brings together a keypad and a box where the entered values are displayed. Kind of looks like a calculator, though it doesn't behave as one.
@author Sharfudeen Ashraf @author John Blanco @author Jonathan Olson <jonathan.olson@colorado.edu>
Class NumberEntryControl¶
@deprecated depends on NumberKeypad, which is deprecated. Modify this to use Keypad, or create something new.
Constructor¶
new NumberEntryControl( options )¶
Instance Methods¶
getValue()¶
Returns the numeric value of the currently entered number (0 for nothing entered). @public
@returns {number}
setValue( number )¶
Sets the currently entered number. @public
@param {number} number
clear()¶
Clears the keypad, so nothing is entered @public
getClearOnNextKeyPress()¶
Will pressing a key (except for the backspace point) clear the existing value? @returns {boolean} @public
setClearOnNextKeyPress( clearOnNextKeyPress )¶
Determines whether pressing a key (except for the backspace) will clear the existing value. @public
@param {boolean} clearOnNextKeyPress
Source Code¶
See the source for NumberEntryControl.js in the scenery-phet repository.