libgdx API

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

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.tablelayout.Table
              extended by com.badlogic.gdx.scenes.scene2d.ui.Button
All Implemented Interfaces:
Layout
Direct Known Subclasses:
CheckBox

public class Button
extends Table


Nested Class Summary
static class Button.ButtonStyle
          Defines a button style, see Button
 
Field Summary
 boolean isChecked
           
 Button.ButtonStyle style
           
 
Fields inherited from class com.badlogic.gdx.scenes.scene2d.ui.tablelayout.Table
isPressed
 
Fields inherited from class com.badlogic.gdx.scenes.scene2d.Group
batchTransform, children, debug, debugTexture, focusedActor, groups, immutableChildren, immutableGroups, keyboardFocusedActor, lastTouchedChild, localTransform, namesToActors, oldBatchTransform, point, scrollFocusedActor, transform, worldTransform
 
Fields inherited from class com.badlogic.gdx.scenes.scene2d.Actor
actions, color, height, name, originX, originY, parent, rotation, scaleX, scaleY, touchable, visible, width, x, y
 
Constructor Summary
Button(Actor child, Button.ButtonStyle style)
           
Button(Actor child, Skin skin)
           
Button(Button.ButtonStyle style)
           
Button(Button.ButtonStyle style, java.lang.String name)
           
Button(Skin skin)
           
Button(java.lang.String text, Button.ButtonStyle style)
           
Button(java.lang.String text, Button.ButtonStyle style, java.lang.String name)
           
Button(java.lang.String text, Skin skin)
           
 
Method Summary
 void draw(SpriteBatch batch, float parentAlpha)
          Draws the Actor.
 java.lang.String getText()
           
 void setClickListener(ClickListener listener)
           
 void setStyle(Button.ButtonStyle style)
           
 void setText(java.lang.String text)
           
 
Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.tablelayout.Table
add, align, align, bottom, center, clear, click, columnDefaults, debug, debug, debug, defaults, drawDebug, enableClipping, getAlign, getAllCells, getAllCells, getCell, getCell, getCells, getDebug, getHeight, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getPadBottom, getPadLeft, getPadRight, getPadTop, getPrefHeight, getPrefWidth, getTableLayout, getWidget, getWidgets, getWidgets, height, height, hit, invalidate, invalidateHierarchy, layout, left, pad, pad, pad, pad, padBottom, padBottom, padLeft, padLeft, padRight, padRight, padTop, padTop, parse, parse, register, reset, right, row, setActor, setBackground, size, size, stack, top, touchDown, touchUp, width, width
 
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Group
act, addActor, addActorAfter, addActorAt, addActorBefore, applyTransform, disableDebugging, drawChild, drawChildren, enableDebugging, findActor, focus, getActors, getGroups, keyboardFocus, keyDown, keyTyped, keyUp, removeActor, removeActorRecursive, resetTransform, scrolled, scrollFocus, sortChildren, swapActor, swapActor, toChildCoordinates, touchDragged, touchMoved, unfocusAll, unfocusAll, updateTransform
 
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Actor
action, clearActions, isMarkedToRemove, markToRemove, remove, toLocalCoordinates, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

style

public Button.ButtonStyle style

isChecked

public boolean isChecked
Constructor Detail

Button

public Button(Skin skin)

Button

public Button(Button.ButtonStyle style)

Button

public Button(Actor child,
              Skin skin)

Button

public Button(Actor child,
              Button.ButtonStyle style)

Button

public Button(java.lang.String text,
              Skin skin)

Button

public Button(java.lang.String text,
              Button.ButtonStyle style)

Button

public Button(java.lang.String text,
              Button.ButtonStyle style,
              java.lang.String name)

Button

public Button(Button.ButtonStyle style,
              java.lang.String name)
Method Detail

setStyle

public void setStyle(Button.ButtonStyle style)

setClickListener

public void setClickListener(ClickListener listener)
Overrides:
setClickListener in class Table

setText

public void setText(java.lang.String text)

getText

public java.lang.String getText()

draw

public void draw(SpriteBatch batch,
                 float parentAlpha)
Description copied from class: Actor
Draws the Actor. The spriteBatch is configured so that the Actor can draw in its parents coordinate system. The parent's alpha is passed to the method in order for the Actor to multiply it with its own alpha. This will allow FadeIn and other Actions to have an effect even if they are only set on the parent of the Actor.

Overrides:
draw in class Table
Parameters:
batch - the spritebatch to render with
parentAlpha - the parent's alpha value.

libgdx API

Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)