Modifier and Type | Field and Description |
---|---|
protected ImageRenderNode |
renderNode |
deferredLayout, deferredRender, deferredUpdate, effects, height, styleId, visibility, width, x, y, zIndex
Constructor and Description |
---|
Image()
Constructor.
|
Image(float x,
float y,
float width,
float height)
Constructor
|
Image(java.lang.String id)
Constructor
|
Image(java.lang.String id,
float x,
float y,
float width,
float height)
Constructor
|
Image(java.lang.String id,
java.lang.String texturePath)
Constructor
|
Image(java.lang.String id,
Texture texture)
Constructor
|
Image(java.lang.String id,
TextureRegion textureRegion)
Constructor
|
Image(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 |
protected void |
estimateSize() |
java.lang.String |
getAtlas()
Returns the atlas (if any) to look up the texture in
|
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 |
getTexturePath()
Returns the current texture path
|
TextureRegion |
getTextureRegion(AssetManager assetManager)
Returns the current
TextureRegion for this Image |
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
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 |
setRenderNodeDirty() |
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(Texture texture)
|
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 |
shrinkToImageSize(AssetManager assetManager) |
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 ImageRenderNode renderNode
public Image()
Image
public Image(java.lang.String id)
id
- The unique ID for this Image
public Image(float x, float y, float width, float height)
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 Image(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 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(Texture texture)
Image
texture
- The Texture
to usepublic Image(TextureRegion textureRegion)
Image
textureRegion
- The TextureRegion
to usepublic Image(java.lang.String id, Texture texture)
public Image(java.lang.String id, TextureRegion textureRegion)
id
- The unique ID for this Image
textureRegion
- The TextureRegion
to usepublic void postDeserialize()
protected void estimateSize()
public void shrinkToImageSize(AssetManager assetManager)
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 getTextureRegion(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 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 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