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.Table
com.badlogic.gdx.scenes.scene2d.ui.Button
com.badlogic.gdx.scenes.scene2d.ui.ImageButton
- All Implemented Interfaces:
- Cullable, Disableable, 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
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.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 |
ImageButton
public ImageButton(Skin skin)
ImageButton
public ImageButton(Skin skin,
String styleName)
ImageButton
public ImageButton(ImageButton.ImageButtonStyle style)
ImageButton
public ImageButton(Drawable imageUp)
ImageButton
public ImageButton(Drawable imageUp,
Drawable imageDown)
ImageButton
public ImageButton(Drawable imageUp,
Drawable imageDown,
Drawable imageChecked)
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
parentAlpha
- Should be multiplied with the actor's alpha, allowing a parent's alpha to affect all children.
getImage
public Image getImage()
getImageCell
public Cell getImageCell()
Copyright © 2013. All Rights Reserved.