TextKeyNode¶
Overview¶
TextKeyNode is a KeyNode with a text icon. It has layout, spacing, and defaults for KeyNode that are suited for text.
@author Jesse Greenberg
Class TextKeyNode¶
Constructor¶
new TextKeyNode( string : string | TReadOnlyProperty<string>, providedOptions? : TextKeyNodeOptions )¶
Instance Methods¶
Static Methods¶
getAltKeyString() : PhetioProperty<string>¶
Returns the correct platform dependent key string for "Alt". "Alt" on Windows, "Option" on Mac.
altOrOption( providedOptions? : KeyNodeOptions ) : KeyNode¶
Static factory methods for specific text strings. For brevity, these methods have the same names as their string keys. For example SceneryPhetStrings.key.esc is rendered by the esc method.
Note that this will render "Alt" OR "Options", depending on platform. If there is a description of this icon in the PDOM please use getAltKeyString().
capsLock( providedOptions? : KeyNodeOptions ) : KeyNode¶
esc( providedOptions? : KeyNodeOptions ) : KeyNode¶
end( providedOptions? : KeyNodeOptions ) : KeyNode¶
enter( providedOptions? : KeyNodeOptions ) : KeyNode¶
fn( providedOptions? : KeyNodeOptions ) : KeyNode¶
home( providedOptions? : KeyNodeOptions ) : KeyNode¶
pageDown( providedOptions? : KeyNodeOptions ) : KeyNode¶
pageUp( providedOptions? : KeyNodeOptions ) : KeyNode¶
space( providedOptions? : KeyNodeOptions ) : KeyNode¶
shift( providedOptions? : KeyNodeOptions ) : KeyNode¶
tab( providedOptions? : KeyNodeOptions ) : KeyNode¶
Type TextKeyNodeOptions¶
- font?: Font
- fill?: TColor
- textMaxWidth?: number
- & KeyNodeOptions
Source Code¶
See the source for TextKeyNode.ts in the scenery-phet repository.