public class TextraLabel
extends com.badlogic.gdx.scenes.scene2d.ui.Widget
Font rather than a libGDX BitmapFont. This supports being
laid out in a Table just like the typical Label.
| Modifier and Type | Field and Description |
|---|---|
int |
align |
Font |
font |
Layout |
layout |
java.lang.String |
storedText |
boolean |
wrap |
| Constructor and Description |
|---|
TextraLabel() |
TextraLabel(java.lang.String text,
Font font) |
TextraLabel(java.lang.String text,
Font font,
com.badlogic.gdx.graphics.Color color) |
TextraLabel(java.lang.String text,
com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle style) |
TextraLabel(java.lang.String text,
com.badlogic.gdx.scenes.scene2d.ui.Skin skin) |
TextraLabel(java.lang.String text,
com.badlogic.gdx.scenes.scene2d.ui.Skin skin,
java.lang.String styleName) |
| Modifier and Type | Method and Description |
|---|---|
void |
draw(com.badlogic.gdx.graphics.g2d.Batch batch,
float parentAlpha) |
int |
getAlignment()
Gets the alignment for the text in this TextraLabel.
|
float |
getPrefHeight() |
float |
getPrefWidth() |
boolean |
isWrap() |
void |
layout() |
void |
setAlignment(int alignment)
Sets the alignment for the text in this TextraLabel.
|
void |
setSize(float width,
float height) |
void |
setText(java.lang.String markupText)
Changes the text in this TextraLabel to the given String, parsing any markup in it.
|
void |
setWrap(boolean wrap) |
getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, invalidate, invalidateHierarchy, needsLayout, pack, setFillParent, setLayoutEnabled, sizeChanged, validateact, addAction, addCaptureListener, addListener, ancestorsVisible, ascendantsVisible, clear, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, drawDebug, drawDebugBounds, fire, firstAscendant, getActions, getCaptureListeners, getColor, getDebug, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getWidth, getX, getX, getY, getY, getZIndex, hasActions, hasKeyboardFocus, hasParent, hasScrollFocus, hit, isAscendantOf, isDescendantOf, isTouchable, isTouchFocusListener, isTouchFocusTarget, isVisible, localToActorCoordinates, localToAscendantCoordinates, localToParentCoordinates, localToScreenCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, positionChanged, remove, removeAction, removeCaptureListener, removeListener, rotateBy, rotationChanged, scaleBy, scaleBy, scaleChanged, screenToLocalCoordinates, setBounds, setColor, setColor, setDebug, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setParent, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setStage, setTouchable, setUserObject, setVisible, setWidth, setX, setX, setY, setY, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFront, toStringpublic Layout layout
public Font font
public int align
public boolean wrap
public java.lang.String storedText
public TextraLabel()
public TextraLabel(java.lang.String text,
com.badlogic.gdx.scenes.scene2d.ui.Skin skin)
public TextraLabel(java.lang.String text,
com.badlogic.gdx.scenes.scene2d.ui.Skin skin,
java.lang.String styleName)
public TextraLabel(java.lang.String text,
com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle style)
public TextraLabel(java.lang.String text,
Font font)
public TextraLabel(java.lang.String text,
Font font,
com.badlogic.gdx.graphics.Color color)
public void draw(com.badlogic.gdx.graphics.g2d.Batch batch,
float parentAlpha)
draw in class com.badlogic.gdx.scenes.scene2d.ui.Widgetpublic float getPrefWidth()
getPrefWidth in interface com.badlogic.gdx.scenes.scene2d.utils.LayoutgetPrefWidth in class com.badlogic.gdx.scenes.scene2d.ui.Widgetpublic float getPrefHeight()
getPrefHeight in interface com.badlogic.gdx.scenes.scene2d.utils.LayoutgetPrefHeight in class com.badlogic.gdx.scenes.scene2d.ui.Widgetpublic boolean isWrap()
public void setWrap(boolean wrap)
public void setSize(float width,
float height)
setSize in class com.badlogic.gdx.scenes.scene2d.Actorpublic void layout()
layout in interface com.badlogic.gdx.scenes.scene2d.utils.Layoutlayout in class com.badlogic.gdx.scenes.scene2d.ui.Widgetpublic int getAlignment()
Align.AlignAlignpublic void setAlignment(int alignment)
alignment - a constant from AlignAlignpublic void setText(java.lang.String markupText)
markupText - a String that can contain Font markup