public class ImageButton extends Button
Modifier and Type | Field and Description |
---|---|
protected Image |
image |
asyncAddQueue, asyncRemoveAll, asyncRemoveQueue, children, renderNode
Constructor and Description |
---|
ImageButton()
Constructor.
|
ImageButton(java.lang.String id)
Constructor
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAtlas()
Returns the atlas (if any) to look up the texture in
|
Image |
getImage()
Returns the backing
Image for the button |
java.lang.String |
getTexturePath()
Returns the current texture path
|
TextureRegion |
getTextureRegion(com.badlogic.gdx.assets.AssetManager assetManager)
Returns the current
TextureRegion for this ImageButton |
boolean |
isResponsive()
Returns if the image should scale to the size of the
ImageButton |
void |
setAtlas(java.lang.String atlas)
Sets the atlas to look up the texture in
|
void |
setResponsive(boolean responsive)
Sets if the image should scale to the size of the
ImageButton |
void |
setTexture(com.badlogic.gdx.graphics.Texture texture)
Sets the current
Texture used by this ImageButton |
void |
setTexturePath(java.lang.String texturePath)
Sets the current texture path.
|
void |
setTextureRegion(TextureRegion textureRegion)
Sets the current
TextureRegion used by this ImageButton |
addActionListener, createRenderNode, isEnabled, notifyActionListenersOfBeginEvent, notifyActionListenersOfEndEvent, removeActionListener, setEnabled
add, add, addAsync, attach, detach, get, getElementById, getFlexDirection, getHorizontalLayout, getTotalChildren, getVerticalLayout, isOverflowClipped, remove, remove, removeAll, removeAllAsync, removeAsync, setFlexDirection, setHorizontalLayout, setOverflowClipped, setStyleId, setVerticalLayout, setVisibility, setZIndex, syncWithRenderNode
addEffectListener, addHoverListener, applyEffect, defer, defer, equals, getId, getStyleId, getVisibility, getZIndex, hashCode, isDebugEnabled, notifyEffectListenersOnFinished, notifyHoverListenersOnBeginHover, notifyHoverListenersOnEndHover, processDeferred, removeEffectListener, removeHoverListener, setDebugEnabled
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addHoverListener, getId, notifyHoverListenersOnBeginHover, notifyHoverListenersOnEndHover, removeHoverListener
protected Image image
public ImageButton()
ImageButton
public ImageButton(java.lang.String id)
id
- The unique ID for this ImageButton
public TextureRegion getTextureRegion(com.badlogic.gdx.assets.AssetManager assetManager)
TextureRegion
for this ImageButton
assetManager
- The game's AssetManager
TextureRegion
has been setpublic void setTextureRegion(TextureRegion textureRegion)
TextureRegion
used by this ImageButton
textureRegion
- The TextureRegion
to usepublic void setTexture(com.badlogic.gdx.graphics.Texture texture)
Texture
used by this ImageButton
texture
- The Texture
to usepublic java.lang.String getTexturePath()
public void setTexturePath(java.lang.String texturePath)
TextureRegion
by loading it via the AssetManager
texturePath
- The path to the texturepublic java.lang.String getAtlas()
public void setAtlas(java.lang.String atlas)
atlas
- Null if the texture should not be looked up via an atlaspublic boolean isResponsive()
ImageButton
public void setResponsive(boolean responsive)
ImageButton
responsive
-