Table of Contents
Extends: Group
Description
The Button node is a simple widget that generates a buttonSelected
event when the user selects it. The button can display a label and/or an icon, as well as a background image. Fields are provided to customize the label text and color depending on whether or not the button has the key focus. Similarly, the bitmaps used for the icon and background can be specified for both focused and unfocused button states.
By default, the background of the button is only shown when the button has the key focus. Buttons are typically used in a ButtonGroup node that manages which button in the group will have the key focus when the ButtonGroup node receives the focus. When the ButtonGroup node has the focus, the button in the group that has the focus will display the focusBitmapUri
bitmap as its background. When the ButtonGroup node does not have the focus, it remembers which button in the group had the focus and sets that button showFocusFootprint
field to true
, causing it to a render a "footprint" bitmap as a visual indicator that it will be the focused button when the ButtonGroup node receives the focus again. All other buttons in the ButtonGroup node do not display a background image.
When a Button node is created that is not a child of a ButtonGroup node, typically the showFootprintfield
field should be set to true
, so that the button always displays a background image.
Fields
Field | Type | Default | Use |
---|---|---|---|
text | string | "" | Specifies the text to be displayed as the button label |
textColor | color | 0xddddddff | Specifies the color of the button label when the button does not have the key focus. |
focusedTextColor | color | 0x262626ff | Specifies the color of the button label when the button has the key focus. |
textFont | Font |
| Specifies the font of the button label when the button does not have the key focus |
focusedTextFont | Font |
| Specifies the font of the button label when the button has the key focus |
focusFootprintBitmapUri | uri | "" | Specifies the button focus "footprint" bitmap file to display when the button does not have key focus. Only set this field to specify a custom bitmap that differs in appearance from the default bitmap. By default the "footprint" bitmap is not displayed when the button does not have the key focus. To display the background when the button is unfocused, the |
focusBitmapUri | uri | "" | Specifies the button background bitmap file to display when the button has the key focus. Only set this field to specify a custom bitmap that differs in appearance from the default bitmap. |
iconUri | uri | "" | Specifies a bitmap file for the button icon when the button does not have the key focus. Only set this field to specify a custom bitmap that differs in appearance from the default bitmap. For a button with no icon, set this field to an empty string (iconUri="" ). |
focusedIconUri | uri | "" | Specifies a bitmap file for the button icon when the button has the key focus. Only set this field to specify a custom bitmap that differs in appearance from the default bitmap. For a button with no icon, set this field to an empty string (iconUri="" ). |
minWidth | float | 0 | Specifies the minimum width of the button. The minWidth field must be less than or equal to the maxWidth field. |
maxWidth | float | 32767 | Specifies the maximum width of the button. The maxWidth field must be greater than or equal to the minWidth field. |
height | float | 64 | Specifies the height of the button. |
showFocusFootprint | Boolean | false | Controls whether the focus "footprint" bitmap is displayed when the button does not have the key focus. Since the default value of the showFocusFootprint field is false , the "footprint" bitmap is not displayed by default. |
buttonSelected | Event | N/A | Observe-Only |