Table with a checked state and additional style fields for pressed, unpressed, and
checked. Each time a button is clicked, the checked state is toggled. Being a table, a button can contain any other actors.
ChangeEvent is fired when the button is clicked. Cancelling the event will restore the checked button state to what is
was previously.
The preferred size of the button is determined by the background and the button contents.
| Modifier and Type | Class and Description |
|---|---|
| public static class | Button.
The style for a button, see |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv ButtonGroup | |
| private ClickListener | |
| pack-priv boolean | |
| pack-priv boolean | |
| private boolean | |
| private Button. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | draw(Batch batch, float parentAlpha)
Overrides com. If this method is overridden, the super method or |
| protected Drawable | getBackgroundDrawable()
Returns appropriate background drawable from the style based on the current button state. |
| public ButtonGroup | |
| public ClickListener | |
| public float | |
| public float | |
| public float | |
| public float | |
| public boolean | |
| public Button. | getStyle()
Implements com. Returns the button's style. |
| private void | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public void | |
| pack-priv void | |
| public void | setDisabled(boolean isDisabled)
Implements com. When true, the button will not toggle |
| public void | setProgrammaticChangeEvents(boolean programmaticChangeEvents)
If false, |
| public void | setStyle(Button.
Implements com. Set the current style of the actor |
| public void |
| buttonGroup | back to summary |
|---|---|
| pack-priv ButtonGroup<T extends Button> buttonGroup | |
| clickListener | back to summary |
|---|---|
| private ClickListener clickListener | |
| isChecked | back to summary |
|---|---|
| pack-priv boolean isChecked | |
| isDisabled | back to summary |
|---|---|
| pack-priv boolean isDisabled | |
| programmaticChangeEvents | back to summary |
|---|---|
| private boolean programmaticChangeEvents | |
| style | back to summary |
|---|---|
| private Button. | |
| Button | back to summary |
|---|---|
| public Button(Skin skin) | |
| Button | back to summary |
|---|---|
| public Button(Skin skin, String styleName) | |
| Button | back to summary |
|---|---|
| public Button(Actor child, Skin skin, String styleName) | |
| Button | back to summary |
|---|---|
| public Button(Actor child, Button. | |
| Button | back to summary |
|---|---|
| public Button(Button. | |
| Button | back to summary |
|---|---|
| public Button() Creates a button without setting the style or size. At least a style must be set before using this button. | |
| Button | back to summary |
|---|---|
| public Button(Drawable up) | |
| Button | back to summary |
|---|---|
| public Button(Drawable up, Drawable down) | |
| Button | back to summary |
|---|---|
| public Button(Drawable up, Drawable down, Drawable checked) | |
| Button | back to summary |
|---|---|
| public Button(Actor child, Skin skin) | |
| draw | back to summary |
|---|---|
| public void draw(Batch batch, float parentAlpha) Overrides com. Doc from com. If this method is overridden, the super method or | |
| getBackgroundDrawable | back to summary |
|---|---|
| protected Drawable getBackgroundDrawable() Returns appropriate background drawable from the style based on the current button state.
| |
| getButtonGroup | back to summary |
|---|---|
public ButtonGroup
| |
| getClickListener | back to summary |
|---|---|
| public ClickListener getClickListener() | |
| getMinHeight | back to summary |
|---|---|
| public float getMinHeight() Overrides com. Implements com. | |
| getMinWidth | back to summary |
|---|---|
| public float getMinWidth() Overrides com. Implements com. | |
| getPrefHeight | back to summary |
|---|---|
| public float getPrefHeight() Overrides com. Implements com. | |
| getPrefWidth | back to summary |
|---|---|
| public float getPrefWidth() Overrides com. Implements com. | |
| getProgrammaticChangeEvents | back to summary |
|---|---|
| public boolean getProgrammaticChangeEvents() | |
| getStyle | back to summary |
|---|---|
| public Button. Implements com. Returns the button's style. Modifying the returned style may not have an effect until | |
| initialize | back to summary |
|---|---|
| private void initialize() | |
| isChecked | back to summary |
|---|---|
| public boolean isChecked() | |
| isDisabled | back to summary |
|---|---|
| public boolean isDisabled() Implements com. | |
| isOver | back to summary |
|---|---|
| public boolean isOver() | |
| isPressed | back to summary |
|---|---|
| public boolean isPressed() | |
| setChecked | back to summary |
|---|---|
| public void setChecked(boolean isChecked) | |
| setChecked | back to summary |
|---|---|
| pack-priv void setChecked(boolean isChecked, boolean fireEvent) | |
| setDisabled | back to summary |
|---|---|
| public void setDisabled(boolean isDisabled) Implements com. When true, the button will not toggle | |
| setProgrammaticChangeEvents | back to summary |
|---|---|
| public void setProgrammaticChangeEvents(boolean programmaticChangeEvents) If false, | |
| setStyle | back to summary |
|---|---|
| public void setStyle(Button. Implements com. Doc from com. Set the current style of the actor | |
| toggle | back to summary |
|---|---|
| public void toggle() Toggles the checked state. This method changes the checked state, which fires a | |
Button.
| Modifier and Type | Field and Description |
|---|---|
| public Drawable | |
| public Drawable | |
| public Drawable | |
| public float | |
| public float | |
| public Drawable | |
| public Drawable | |
| public Drawable | |
| public Drawable | |
| public Drawable | |
| public float | |
| public float | |
| public float | |
| public float | |
| public Drawable |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| checked | back to summary |
|---|---|
| public Drawable checked
| |
| checkedDown | back to summary |
|---|---|
| public Drawable checkedDown
| |
| checkedFocused | back to summary |
|---|---|
| public Drawable checkedFocused
| |
| checkedOffsetX | back to summary |
|---|---|
| public float checkedOffsetX | |
| checkedOffsetY | back to summary |
|---|---|
| public float checkedOffsetY | |
| checkedOver | back to summary |
|---|---|
| public Drawable checkedOver
| |
| disabled | back to summary |
|---|---|
| public Drawable disabled
| |
| down | back to summary |
|---|---|
| public Drawable down
| |
| focused | back to summary |
|---|---|
| public Drawable focused
| |
| over | back to summary |
|---|---|
| public Drawable over
| |
| pressedOffsetX | back to summary |
|---|---|
| public float pressedOffsetX | |
| pressedOffsetY | back to summary |
|---|---|
| public float pressedOffsetY | |
| unpressedOffsetX | back to summary |
|---|---|
| public float unpressedOffsetX | |
| unpressedOffsetY | back to summary |
|---|---|
| public float unpressedOffsetY | |
| up | back to summary |
|---|---|
| public Drawable up
| |
| ButtonStyle | back to summary |
|---|---|
| public ButtonStyle() | |
| ButtonStyle | back to summary |
|---|---|
| public ButtonStyle(Drawable up, Drawable down, Drawable checked) | |
| ButtonStyle | back to summary |
|---|---|
| public ButtonStyle(Button. | |