Modifier and Type | Field and Description |
---|---|
protected AnimatedImageRenderNode |
renderNode |
deferredLayout, deferredRender, deferredUpdate, effects, height, styleId, visibility, width, x, y, zIndex
Constructor and Description |
---|
AnimatedImage()
Constructor.
|
AnimatedImage(java.lang.String id)
Constructor
|
AnimatedImage(java.lang.String id,
float x,
float y,
float width,
float height)
Constructor
|
AnimatedImage(java.lang.String id,
java.lang.String[] texturePaths,
float[] durations)
Constructor
|
AnimatedImage(java.lang.String id,
Texture[] textures,
float[] durations)
Constructor
|
AnimatedImage(java.lang.String id,
TextureRegion[] textureRegions,
float[] durations)
Constructor
|
AnimatedImage(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 |
protected void |
estimateSize() |
java.lang.String |
getAtlas()
Returns the atlas (if any) to look up the texture in
|
float[] |
getFrameDurations()
Returns the animation frame durations
|
int |
getRenderHeight()
Returns the height this element is currently rendering at
|
int |
getRenderWidth()
Returns the width this element is currently rendering at
|
int |
getRenderX()
Returns X coordinate of where this element is currently rendering
|
int |
getRenderY()
Returns Y coordinate of where this element is currently rendering
|
StyleRule |
getStyleRule() |
java.lang.String[] |
getTexturePaths()
Returns the texture paths for the animation
|
TextureRegion[] |
getTextureRegions(AssetManager assetManager)
Returns the current
TextureRegion array for this
AnimatedImage |
void |
invokeBeginHover()
Triggers the begin hover event
|
void |
invokeEndHover()
Triggers the end hover event
|
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 |
isInitialLayoutOccurred() |
boolean |
isInitialUpdateOccurred() |
boolean |
isRenderNodeDirty() |
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 |
setRenderNodeDirty() |
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(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 |
syncWithUpdate(UiContainerRenderTree rootNode)
Syncs data between the
UiElement and RenderNode during update |
addEffectListener, addHoverListener, addNodeStateListener, alignAbove, alignBelow, alignEdgeToEdge, alignLeftOf, alignRightOf, applyEffect, deferUntilLayout, deferUntilLayout, deferUntilRender, deferUntilRender, deferUntilUpdate, deferUntilUpdate, deferUntilUpdate, deferUntilUpdate, equals, getContentHeight, getContentWidth, getElementById, getHeight, getId, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getStyleId, getVisibility, getWidth, getX, getY, getZIndex, hashCode, isDebugEnabled, isFlexLayout, isInitialised, notifyEffectListenersOnFinished, notifyHoverListenersOnBeginHover, notifyHoverListenersOnEndHover, notifyNodeStateListeners, removeEffectListener, removeHoverListener, removeNodeStateListener, set, setContentHeight, setContentWidth, setDebugEnabled, setHeight, setHeightToContentHeightOf, setHeightToHeightOf, setWidth, setWidthToContentWidthOf, setWidthToWidthOf, setX, setXY, setY, snapTo, snapTo, syncWithLayout, syncWithRender
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, float x, float y, float width, float height)
id
- The unique ID for this element (if null an ID will be generated)x
- The x coordinate of this element relative to its parenty
- The y coordinate of this element relative to its parentwidth
- The width of this elementheight
- The height of this elementpublic 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(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, 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()
protected void estimateSize()
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 invokeBeginHover()
Hoverable
public void invokeEndHover()
Hoverable
public TextureRegion[] getTextureRegions(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(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 syncWithUpdate(UiContainerRenderTree rootNode)
UiElement
UiElement
and RenderNode
during updatesyncWithUpdate
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 StyleRule getStyleRule()
getStyleRule
in class UiElement
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 flippedpublic boolean isRenderNodeDirty()
isRenderNodeDirty
in class UiElement
public void setRenderNodeDirty()
setRenderNodeDirty
in class UiElement
public boolean isInitialLayoutOccurred()
isInitialLayoutOccurred
in class UiElement
public boolean isInitialUpdateOccurred()
isInitialUpdateOccurred
in class UiElement
public int getRenderX()
UiElement
getRenderX
in class UiElement
Integer.MIN_VALUE
if not renderingpublic int getRenderY()
UiElement
getRenderY
in class UiElement
Integer.MIN_VALUE
if not renderingpublic int getRenderWidth()
UiElement
getRenderWidth
in class UiElement
public int getRenderHeight()
UiElement
getRenderHeight
in class UiElement