com.badlogic.gdx.scenes.scene2d.ui
Class TextButton

java.lang.Object
  extended by com.badlogic.gdx.scenes.scene2d.Actor
      extended by com.badlogic.gdx.scenes.scene2d.Group
          extended by com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
              extended by com.badlogic.gdx.scenes.scene2d.ui.Table
                  extended by com.badlogic.gdx.scenes.scene2d.ui.Button
                      extended by com.badlogic.gdx.scenes.scene2d.ui.TextButton
All Implemented Interfaces:
Cullable, Disableable, Layout
Direct Known Subclasses:
CheckBox

public class TextButton
extends Button

A button with a child Label to display text.

Author:
Nathan Sweet

Nested Class Summary
static class TextButton.TextButtonStyle
          The style for a text button, see TextButton.
 
Nested classes/interfaces inherited from class com.badlogic.gdx.scenes.scene2d.ui.Button
Button.ButtonStyle
 
Constructor Summary
TextButton(String text, Skin skin)
           
TextButton(String text, Skin skin, String styleName)
           
TextButton(String text, TextButton.TextButtonStyle style)
           
 
Method Summary
 void draw(SpriteBatch batch, float parentAlpha)
          If this method is overridden, the super method or WidgetGroup.validate() should be called to ensure the widget group is laid out.
 Label getLabel()
           
 Cell getLabelCell()
           
 TextButton.TextButtonStyle getStyle()
          Returns the button's style.
 CharSequence getText()
           
 void setStyle(Button.ButtonStyle style)
           
 void setText(String text)
           
 
Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.Button
getClickListener, getMinHeight, getMinWidth, getPrefHeight, getPrefWidth, isChecked, isDisabled, isOver, isPressed, setChecked, setDisabled, toggle
 
Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.Table
add, add, add, add, add, add, align, bottom, center, clearChildren, columnDefaults, debug, debug, debugCell, debugTable, debugWidget, defaults, drawDebug, getAlign, getBackground, getCell, getCells, getClip, getDebug, getPadBottom, getPadBottomValue, getPadLeft, getPadLeftValue, getPadRight, getPadRightValue, getPadTop, getPadTopValue, getPadX, getPadY, getRow, hit, invalidate, layout, left, pad, pad, pad, pad, padBottom, padBottom, padLeft, padLeft, padRight, padRight, padTop, padTop, removeActor, reset, right, row, setBackground, setBackground, setClip, setRound, setSkin, stack, top
 
Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
getMaxHeight, getMaxWidth, invalidateHierarchy, needsLayout, pack, setFillParent, setLayoutEnabled, validate
 
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Group
act, addActor, addActorAfter, addActorAt, addActorBefore, clear, findActor, getChildren, hasChildren, isTransform, localToDescendantCoordinates, print, setCullingArea, setTransform, swapActor, swapActor
 
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Actor
addAction, addCaptureListener, addListener, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, fire, getActions, getCaptureListeners, getColor, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getWidth, getX, getY, getZIndex, hasParent, isAscendantOf, isDescendantOf, isVisible, localToAscendantCoordinates, localToParentCoordinates, localToStageCoordinates, notify, parentToLocalCoordinates, remove, removeAction, removeCaptureListener, removeListener, rotate, scale, scale, screenToLocalCoordinates, setBounds, setColor, setColor, setHeight, setName, setOrigin, setOriginX, setOriginY, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setVisible, setWidth, setX, setY, setZIndex, size, size, stageToLocalCoordinates, toBack, toFront, toString, translate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextButton

public TextButton(String text,
                  Skin skin)

TextButton

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

TextButton

public TextButton(String text,
                  TextButton.TextButtonStyle style)
Method Detail

setStyle

public void setStyle(Button.ButtonStyle style)
Overrides:
setStyle in class Button

getStyle

public TextButton.TextButtonStyle getStyle()
Description copied from class: Button
Returns the button's style. Modifying the returned style may not have an effect until Button.setStyle(ButtonStyle) is called.

Overrides:
getStyle in class Button

draw

public void draw(SpriteBatch batch,
                 float parentAlpha)
Description copied from class: WidgetGroup
If this method is overridden, the super method or WidgetGroup.validate() should be called to ensure the widget group is laid out.

Overrides:
draw in class Button
parentAlpha - Should be multiplied with the actor's alpha, allowing a parent's alpha to affect all children.

getLabel

public Label getLabel()

getLabelCell

public Cell getLabelCell()

setText

public void setText(String text)

getText

public CharSequence getText()


Copyright © 2013. All Rights Reserved.