com.badlogic.gdx.scenes.scene2d.ui
Class ImageButton
java.lang.Object
com.badlogic.gdx.scenes.scene2d.Actor
com.badlogic.gdx.scenes.scene2d.Group
com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
com.badlogic.gdx.scenes.scene2d.ui.tablelayout.Table
com.badlogic.gdx.scenes.scene2d.ui.Button
com.badlogic.gdx.scenes.scene2d.ui.ImageButton
- All Implemented Interfaces:
- Cullable, Layout
public class ImageButton
- extends Button
A button with a child Image
to display an image. This is useful when the button must be larger than the image and the
image centered on the button. If the image is the size of the button, a Button
without any children can be used, where
the Button.ButtonStyle.up
, Button.ButtonStyle.down
, and Button.ButtonStyle.checked
nine patches define
the image.
- Author:
- Nathan Sweet
Fields inherited from class com.badlogic.gdx.scenes.scene2d.ui.tablelayout.Table |
clip, isPressed |
Fields inherited from class com.badlogic.gdx.scenes.scene2d.Group |
batchTransform, children, cullingArea, debug, debugTexture, groups, immutableChildren, immutableGroups, lastTouchedChild, localTransform, namesToActors, oldBatchTransform, point, transform, worldTransform |
Fields inherited from class com.badlogic.gdx.scenes.scene2d.Actor |
actions, color, height, name, originX, originY, parent, rotation, scaleX, scaleY, stage, touchable, visible, width, x, y |
Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.tablelayout.Table |
add, add, add, align, align, bottom, center, clear, click, columnDefaults, debug, debug, debug, defaults, drawBackground, drawDebug, getAlign, getAllCells, getAllCells, getBackgroundPatch, getCell, getCell, getCells, getClickListener, getDebug, getHeight, getPadBottom, getPadLeft, getPadRight, getPadTop, getRow, getTableLayout, getWidget, getWidgets, getWidgets, height, height, invalidate, layout, left, newTable, pad, pad, pad, pad, padBottom, padBottom, padLeft, padLeft, padRight, padRight, padTop, padTop, parse, parse, register, reset, right, row, setAssetManager, setBackground, setClip, setSkin, setWidget, 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, getActors, getGroups, hit, isDescendant, removeActor, removeActorRecursive, resetTransform, setCullingArea, sortChildren, swapActor, swapActor, toChildCoordinates, toLocalCoordinates, touchMoved, updateTransform |
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Actor |
action, clearActions, getStage, isMarkedToRemove, keyDown, keyTyped, keyUp, markToRemove, remove, scrolled, toLocalCoordinates, toString, touchDragged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ImageButton
public ImageButton(Skin skin)
ImageButton
public ImageButton(ImageButton.ImageButtonStyle style)
ImageButton
public ImageButton(ImageButton.ImageButtonStyle style,
java.lang.String name)
ImageButton
public ImageButton(TextureRegion region)
ImageButton
public ImageButton(TextureRegion regionUp,
TextureRegion regionDown)
ImageButton
public ImageButton(TextureRegion regionUp,
TextureRegion regionDown,
TextureRegion regionChecked)
ImageButton
public ImageButton(NinePatch patch)
ImageButton
public ImageButton(NinePatch patchUp,
NinePatch patchDown)
ImageButton
public ImageButton(NinePatch patchUp,
NinePatch patchDown,
NinePatch patchChecked)
setStyle
public void setStyle(Button.ButtonStyle style)
- Overrides:
setStyle
in class Button
getStyle
public ImageButton.ImageButtonStyle 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
- Parameters:
batch
- the spritebatch to render withparentAlpha
- the parent's alpha value.
getImage
public Image getImage()
getImageCell
public Cell getImageCell()
Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)