Modifier and Type | Field and Description |
---|---|
static com.badlogic.gdx.graphics.Color |
COLOR_BLACK
A blending-safe black
Color value |
static com.badlogic.gdx.graphics.Color |
COLOR_WHITE
A blending-safe white
Color value |
protected LabelRenderNode |
renderNode |
deferredQueue, effects, styleId, visibility, zIndex
Constructor and Description |
---|
Label()
Constructor.
|
Label(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 |
defer(java.lang.Runnable runnable)
Defers the execution of a
Runnable instance until the next frame update |
void |
detach(ParentRenderNode<?,?> parentRenderNode)
Detaches this element's
RenderNode from a parent
RenderNode |
com.badlogic.gdx.graphics.Color |
getColor()
Returns the
Color of the label |
HorizontalAlignment |
getHorizontalAlignment()
Returns the
HorizontalAlignment of the text |
java.lang.String |
getText()
Returns the current text of the label
|
TextAnimation |
getTextAnimation()
Returns the current
TextAnimation of the label |
boolean |
isResponsive()
Returns if this label should fill its available space
|
void |
setColor(com.badlogic.gdx.graphics.Color color)
Sets the
Color of the label |
void |
setHorizontalAlignment(HorizontalAlignment horizontalAlignment)
Sets the
HorizontalAlignment of the text |
void |
setResponsive(boolean responsive)
Sets if this label should fill its available space
|
void |
setStyleId(java.lang.String styleId)
Sets the style if for this
UiElement |
void |
setText(java.lang.String text)
Sets the current text of the label
|
void |
setTextAnimation(TextAnimation textAnimation)
Sets the current
TextAnimation of the label |
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, equals, getElementById, getId, getStyleId, getVisibility, getZIndex, hashCode, isDebugEnabled, notifyEffectListenersOnFinished, notifyHoverListenersOnBeginHover, notifyHoverListenersOnEndHover, removeEffectListener, removeHoverListener, setDebugEnabled
public static final com.badlogic.gdx.graphics.Color COLOR_WHITE
Color
valuepublic static final com.badlogic.gdx.graphics.Color COLOR_BLACK
Color
valueprotected LabelRenderNode renderNode
public Label()
Label
public Label(java.lang.String id)
id
- The unique ID of the Label
public java.lang.String getText()
String
public void setText(java.lang.String text)
text
- A non-null String
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 defer(java.lang.Runnable runnable)
UiElement
Runnable
instance until the next frame updatepublic 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 HorizontalAlignment getHorizontalAlignment()
HorizontalAlignment
of the textHorizontalAlignment.LEFT
by defaultpublic void setHorizontalAlignment(HorizontalAlignment horizontalAlignment)
HorizontalAlignment
of the texthorizontalAlignment
- public boolean isResponsive()
public void setResponsive(boolean responsive)
responsive
- False if the width should match the text widthpublic com.badlogic.gdx.graphics.Color getColor()
Color
of the labelColor
is set by the UiTheme
public void setColor(com.badlogic.gdx.graphics.Color color)
Color
of the labelcolor
- Null if the Color
should be retrieved from the UiTheme
public TextAnimation getTextAnimation()
TextAnimation
of the labelpublic void setTextAnimation(TextAnimation textAnimation)
TextAnimation
of the labeltextAnimation
- Null if no animation is to be played