APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.badlogic.gdx.scenes.scene2d.ui

public Class TextButton

extends Button
Class Inheritance
Known Direct Subclasses
com.badlogic.gdx.scenes.scene2d.ui.CheckBox
Imports
com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.g2d.Batch, .BitmapFont, com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle, com.badlogic.gdx.scenes.scene2d.utils.Drawable, com.badlogic.gdx.utils.Align, .Null

A button with a child Label to display text.
Author
Nathan Sweet

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
TextButton.TextButtonStyle

The style for a text button, see TextButton.

Field Summary

Modifier and TypeField and Description
private Label
private TextButton.TextButtonStyle
Inherited from com.badlogic.gdx.scenes.scene2d.ui.Button:
buttonGroupisCheckedisDisabled

Constructor Summary

AccessConstructor and Description
public
TextButton(String text, Skin skin)

public
TextButton(String text, Skin skin, String styleName)

public

Method Summary

Modifier and TypeMethod and Description
public void
draw(Batch batch, float parentAlpha)

Overrides com.badlogic.gdx.scenes.scene2d.ui.Button.draw.

If this method is overridden, the super method or validate() should be called to ensure the widget group is laid out.

protected Color
getFontColor()

Returns the appropriate label font color from the style based on the current button state.

public Label
public Cell<Label>
public TextButton.TextButtonStyle
public CharSequence
protected Label
public void
setLabel(Label label)

public void
public void
public String
toString()

Overrides com.badlogic.gdx.scenes.scene2d.Group.toString.

Returns a description of the actor hierarchy, recursively.

Inherited from com.badlogic.gdx.scenes.scene2d.ui.Button:
getBackgroundDrawablegetButtonGroupgetClickListenergetMinHeightgetMinWidthgetPrefHeightgetPrefWidthgetProgrammaticChangeEventsisCheckedisDisabledisOverisPressedsetCheckedsetCheckedsetDisabledsetProgrammaticChangeEventstoggle

Field Detail

labelback to summary
private Label label
styleback to summary
private TextButton.TextButtonStyle style

Hides com.badlogic.gdx.scenes.scene2d.ui.Button.style.

Constructor Detail

TextButtonback to summary
public TextButton(String text, Skin skin)
TextButtonback to summary
public TextButton(String text, Skin skin, String styleName)
TextButtonback to summary
public TextButton(String text, TextButton.TextButtonStyle style)

Method Detail

drawback to summary
public void draw(Batch batch, float parentAlpha)

Overrides com.badlogic.gdx.scenes.scene2d.ui.Button.draw.

Doc from com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup.draw.

If this method is overridden, the super method or validate() should be called to ensure the widget group is laid out.

getFontColorback to summary
protected Color getFontColor()

Returns the appropriate label font color from the style based on the current button state.

Annotations
@Null
getLabelback to summary
public Label getLabel()
getLabelCellback to summary
public Cell<Label> getLabelCell()
getStyleback to summary
public TextButton.TextButtonStyle getStyle()

Overrides com.badlogic.gdx.scenes.scene2d.ui.Button.getStyle.

Implements com.badlogic.gdx.scenes.scene2d.ui.Styleable.getStyle.

Doc from com.badlogic.gdx.scenes.scene2d.ui.Button.getStyle.

Returns the button's style. Modifying the returned style may not have an effect until setStyle(ButtonStyle) is called.

getTextback to summary
public CharSequence getText()
newLabelback to summary
protected Label newLabel(String text, Label.LabelStyle style)
setLabelback to summary
public void setLabel(Label label)
setStyleback to summary
public void setStyle(Button.ButtonStyle style)

Overrides com.badlogic.gdx.scenes.scene2d.ui.Button.setStyle.

Implements com.badlogic.gdx.scenes.scene2d.ui.Styleable.setStyle.

Doc from com.badlogic.gdx.scenes.scene2d.ui.Styleable.setStyle.

Set the current style of the actor

setTextback to summary
public void setText(String text)
toStringback to summary
public String toString()

Overrides com.badlogic.gdx.scenes.scene2d.Group.toString.

Doc from com.badlogic.gdx.scenes.scene2d.Group.toString.

Returns a description of the actor hierarchy, recursively.

com.badlogic.gdx.scenes.scene2d.ui back to summary

public Class TextButton.TextButtonStyle

extends ButtonStyle
Class Inheritance
Known Direct Subclasses
com.badlogic.gdx.scenes.scene2d.ui.CheckBox.CheckBoxStyle, com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton.ImageTextButtonStyle

The style for a text button, see TextButton.
Author
Nathan Sweet

Field Summary

Modifier and TypeField and Description
public Color
public Color
public Color
public Color
public Color
public Color
public Color
public BitmapFont
public Color
public Color
Inherited from com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle:
checkedcheckedDowncheckedFocusedcheckedOffsetXcheckedOffsetYcheckedOverdisableddownfocusedoverpressedOffsetXpressedOffsetYunpressedOffsetXunpressedOffsetYup

Constructor Summary

AccessConstructor and Description
public
public
public

Field Detail

checkedDownFontColorback to summary
public Color checkedDownFontColor
Annotations
@Null
checkedFocusedFontColorback to summary
public Color checkedFocusedFontColor
Annotations
@Null
checkedFontColorback to summary
public Color checkedFontColor
Annotations
@Null
checkedOverFontColorback to summary
public Color checkedOverFontColor
Annotations
@Null
disabledFontColorback to summary
public Color disabledFontColor
Annotations
@Null
downFontColorback to summary
public Color downFontColor
Annotations
@Null
focusedFontColorback to summary
public Color focusedFontColor
Annotations
@Null
fontback to summary
public BitmapFont font
fontColorback to summary
public Color fontColor
Annotations
@Null
overFontColorback to summary
public Color overFontColor
Annotations
@Null

Constructor Detail

TextButtonStyleback to summary
public TextButtonStyle()
TextButtonStyleback to summary
public TextButtonStyle(Drawable up, Drawable down, Drawable checked, BitmapFont font)
TextButtonStyleback to summary
public TextButtonStyle(TextButton.TextButtonStyle style)