Modifier and Type | Field and Description |
---|---|
protected AnimatedImageRenderNode |
renderNode |
Constructor and Description |
---|
AnimatedImage()
Constructor.
|
AnimatedImage(java.lang.String id)
Constructor
|
AnimatedImage(java.lang.String id,
java.lang.String[] texturePaths,
float[] durations)
Constructor
|
AnimatedImage(java.lang.String id,
com.badlogic.gdx.graphics.Texture[] textures,
float[] durations)
Constructor
|
AnimatedImage(java.lang.String id,
TextureRegion[] textureRegions,
float[] durations)
Constructor
|
AnimatedImage(com.badlogic.gdx.graphics.Texture[] textures,
float[] durations)
Constructor.
|
AnimatedImage(TextureRegion[] textureRegions,
float[] durations)
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
|
float[] |
getFrameDurations()
Returns the animation frame durations
|
java.lang.String[] |
getTexturePaths()
Returns the texture paths for the animation
|
TextureRegion[] |
getTextureRegions(com.badlogic.gdx.assets.AssetManager assetManager)
Returns the current
TextureRegion array for this
AnimatedImage |
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
AnimatedImage 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
AnimatedImage should scale to the size of its parent |
void |
setStyleId(java.lang.String styleId)
Sets the style if for this
UiElement |
void |
setTexturePaths(java.lang.String[] texturePaths,
float[] durations)
Sets the current texture path array.
|
void |
setTextureRegions(TextureRegion[] textureRegions,
float[] durations)
Sets the current
TextureRegion array used by this
AnimatedImage |
void |
setTextures(com.badlogic.gdx.graphics.Texture[] textures,
float[] durations)
Sets the current
Texture array used by this AnimatedImage |
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 AnimatedImageRenderNode renderNode
public AnimatedImage()
AnimatedImage
public AnimatedImage(java.lang.String id)
id
- The unique ID for this AnimatedImage
public AnimatedImage(java.lang.String id, java.lang.String[] texturePaths, float[] durations)
id
- The unique ID for this AnimatedImage
texturePaths
- The paths for the textures to be loaded by the
AssetManager
durations
- The durations for each frame (in seconds)public AnimatedImage(com.badlogic.gdx.graphics.Texture[] textures, float[] durations)
AnimatedImage
textures
- The Texture
s to use for each framedurations
- The durations for each frame (in seconds)public AnimatedImage(TextureRegion[] textureRegions, float[] durations)
AnimatedImage
textureRegions
- The TextureRegion
s to use for each framedurations
- The durations for each frame (in seconds)public AnimatedImage(java.lang.String id, com.badlogic.gdx.graphics.Texture[] textures, float[] durations)
id
- The unique ID for this AnimatedImage
textures
- The Texture
s to use for each framedurations
- The durations for each frame (in seconds)public AnimatedImage(java.lang.String id, TextureRegion[] textureRegions, float[] durations)
id
- The unique ID for this AnimatedImage
textureRegions
- The TextureRegion
s to use for each framedurations
- The durations for each frame (in seconds)public 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[] getTextureRegions(com.badlogic.gdx.assets.AssetManager assetManager)
TextureRegion
array for this
AnimatedImage
assetManager
- The game's AssetManager
public void setTextureRegions(TextureRegion[] textureRegions, float[] durations)
TextureRegion
array used by this
AnimatedImage
textureRegions
- The TextureRegion
s to use for the animationdurations
- The durations for each frame (in seconds)public void setTextures(com.badlogic.gdx.graphics.Texture[] textures, float[] durations)
Texture
array used by this AnimatedImage
textures
- The Texture
s to use for the animationdurations
- The durations for each frame (in seconds)public java.lang.String[] getTexturePaths()
public float[] getFrameDurations()
public void setTexturePaths(java.lang.String[] texturePaths, float[] durations)
TextureRegion
array by loading it via the AssetManager
texturePaths
- The paths to the textures for the animationdurations
- The durations for each frame (in seconds)public 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()
AnimatedImage
should scale to the size of its
parentpublic void setResponsive(boolean responsive)
AnimatedImage
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