Modifier and Type | Field and Description |
---|---|
protected ImageRenderNode |
renderNode |
Constructor and Description |
---|
Image()
Constructor.
|
Image(java.lang.String id)
Constructor
|
Image(java.lang.String id,
java.lang.String texturePath)
Constructor
|
Image(java.lang.String id,
com.badlogic.gdx.graphics.Texture texture)
Constructor
|
Image(java.lang.String id,
TextureRegion textureRegion)
Constructor
|
Image(com.badlogic.gdx.graphics.Texture texture)
Constructor.
|
Image(TextureRegion textureRegion)
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
|
java.lang.String |
getTexturePath()
Returns the current texture path
|
TextureRegion |
getTextureRegion(com.badlogic.gdx.assets.AssetManager assetManager)
Returns the current
TextureRegion for this Image |
boolean |
isFlipX()
Returns if the texture should be flipped horizontally during rendering
|
boolean |
isFlipY()
Returns if the texture should be flipped vertically during rendering
|
boolean |
isResponsive()
Returns if this
Image should scale to the size of its parent |
void |
postDeserialize() |
void |
setAtlas(java.lang.String atlas)
Sets the atlas to look up the texture in
|
void |
setFlipX(boolean flipX)
Sets if the texture should be flipped horizontally during rendering
|
void |
setFlipY(boolean flipY)
Sets if the texture should be flipped vertically during rendering
|
void |
setResponsive(boolean responsive)
Sets if this
Image should scale to the size of its parent |
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 Image |
void |
setTexturePath(java.lang.String texturePath)
Sets the current texture path.
|
void |
setTextureRegion(TextureRegion textureRegion)
Sets the current
TextureRegion used by this Image |
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 |
addEffectListener, addHoverListener, applyEffect, defer, defer, equals, getElementById, getId, getStyleId, getVisibility, getZIndex, hashCode, isDebugEnabled, notifyEffectListenersOnFinished, notifyHoverListenersOnBeginHover, notifyHoverListenersOnEndHover, processDeferred, removeEffectListener, removeHoverListener, setDebugEnabled
protected ImageRenderNode renderNode
public Image()
Image
public Image(java.lang.String id)
id
- The unique ID for this Image
public Image(java.lang.String id, java.lang.String texturePath)
id
- The unique ID for this Image
texturePath
- The path for the Texture
to be loaded by the
AssetManager
public Image(com.badlogic.gdx.graphics.Texture texture)
Image
texture
- The Texture
to usepublic Image(TextureRegion textureRegion)
Image
textureRegion
- The TextureRegion
to usepublic Image(java.lang.String id, com.badlogic.gdx.graphics.Texture texture)
id
- The unique ID for this Image
texture
- The Texture
to usepublic Image(java.lang.String id, TextureRegion textureRegion)
id
- The unique ID for this Image
textureRegion
- The TextureRegion
to usepublic void postDeserialize()
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 TextureRegion getTextureRegion(com.badlogic.gdx.assets.AssetManager assetManager)
TextureRegion
for this Image
assetManager
- The game's AssetManager
TextureRegion
has been setpublic void setTextureRegion(TextureRegion textureRegion)
TextureRegion
used by this Image
textureRegion
- The TextureRegion
to usepublic void setTexture(com.badlogic.gdx.graphics.Texture texture)
Texture
used by this Image
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()
Image
should scale to the size of its parentpublic void setResponsive(boolean responsive)
Image
should scale to the size of its parentresponsive
- public void setVisibility(Visibility visibility)
UiElement
Visibility
of this UiElement
setVisibility
in class UiElement
visibility
- The Visibility
to setpublic void syncWithRenderNode()
UiElement
UiElement
and RenderNode
syncWithRenderNode
in class UiElement
public void setStyleId(java.lang.String styleId)
UiElement
UiElement
setStyleId
in class UiElement
styleId
- The style id to setpublic void setZIndex(int zIndex)
UiElement
UiElement
. Elements will be rendered on
different Z layers in ascending Z order (negatives values first, positive values last)public boolean isFlipX()
public void setFlipX(boolean flipX)
flipX
- True if the texture should be flippedpublic boolean isFlipY()
public void setFlipY(boolean flipY)
flipY
- True if the texture should be flipped