public class ImageButton extends Button
Button
that only contains an imageeffects, styleId, visibility, zIndex
Constructor and Description |
---|
ImageButton()
Constructor.
|
ImageButton(java.lang.String id)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
attach(ParentRenderNode<?,?> parentRenderNode)
Attaches a
RenderNode for this element to a parent
RenderNode |
void |
detach(ParentRenderNode<?,?> parentRenderNode)
Detaches this element's
RenderNode from a parent
RenderNode |
java.lang.String |
getAtlas()
Returns the atlas (if any) to look up the texture in
|
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 |
setLayout(java.lang.String layout)
Sets the current layout for this
Button |
void |
setResponsive(boolean responsive)
Sets if the image should scale to the size of the
ImageButton |
void |
setStyleId(java.lang.String styleId)
Sets the style if for this
UiElement |
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 |
void |
setVisibility(Visibility visibility)
Sets the current
Visibility of this UiElement |
void |
setZIndex(int zIndex)
Sets the Z index of this
UiElement . |
void |
syncWithRenderNode()
Syncs data between the
UiElement and RenderNode |
addActionListener, getLayout, isEnabled, notifyActionListenersOfBeginEvent, notifyActionListenersOfEndEvent, removeActionListener, setEnabled
addEffectListener, addHoverListener, applyEffect, equals, getElementById, getId, getStyleId, getVisibility, getZIndex, hashCode, isDebugEnabled, notifyEffectListenersOnFinished, notifyHoverListenersOnBeginHover, notifyHoverListenersOnEndHover, removeEffectListener, removeHoverListener, setDebugEnabled
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addHoverListener, getId, notifyHoverListenersOnBeginHover, notifyHoverListenersOnEndHover, removeHoverListener
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 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
- public void attach(ParentRenderNode<?,?> parentRenderNode)
UiElement
RenderNode
for this element to a parent
RenderNode
attach
in class UiElement
parentRenderNode
- The parent RenderNode
to attach topublic void detach(ParentRenderNode<?,?> parentRenderNode)
UiElement
RenderNode
from a parent
RenderNode
detach
in class UiElement
parentRenderNode
- The parent RenderNode
to detach frompublic void setVisibility(Visibility visibility)
UiElement
Visibility
of this UiElement
setVisibility
in class UiElement
visibility
- The Visibility
to setpublic void setStyleId(java.lang.String styleId)
UiElement
UiElement
setStyleId
in class UiElement
styleId
- The style id to setpublic void syncWithRenderNode()
UiElement
UiElement
and RenderNode
syncWithRenderNode
in class UiElement
public void setZIndex(int zIndex)
UiElement
UiElement
. Elements will be rendered on
different Z layers in ascending Z order (negatives values first, positive values last)