public class ColorChangeLabel
extends com.badlogic.gdx.scenes.scene2d.ui.Label
Modifier and Type | Field and Description |
---|---|
protected float |
loopTime |
protected float |
progress |
Modifier | Constructor and Description |
---|---|
protected |
ColorChangeLabel() |
|
ColorChangeLabel(java.lang.CharSequence text,
com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle style,
java.util.Collection<com.badlogic.gdx.graphics.Color> colors)
Constructs a ColorChangeLabel.
|
|
ColorChangeLabel(java.lang.CharSequence text,
com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle style,
com.badlogic.gdx.graphics.Color... colors)
Constructs a ColorChangeLabel.
|
|
ColorChangeLabel(java.lang.CharSequence text,
com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle style,
float loopTime,
boolean doubleWidth,
java.util.Collection<com.badlogic.gdx.graphics.Color> colors)
Constructs a ColorChangeLabel.
|
|
ColorChangeLabel(java.lang.CharSequence text,
com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle style,
float loopTime,
boolean doubleWidth,
com.badlogic.gdx.graphics.Color... colors)
Constructs a ColorChangeLabel.
|
|
ColorChangeLabel(java.lang.CharSequence text,
com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle style,
float loopTime,
java.util.Collection<com.badlogic.gdx.graphics.Color> colors)
Constructs a ColorChangeLabel.
|
|
ColorChangeLabel(java.lang.CharSequence text,
com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle style,
float loopTime,
com.badlogic.gdx.graphics.Color... colors)
Constructs a ColorChangeLabel.
|
Modifier and Type | Method and Description |
---|---|
void |
act(float delta)
Updates the actor based on time.
|
com.badlogic.gdx.graphics.Color |
getColor()
Returns the color the actor will be tinted when drawn.
|
void |
resetLoopTime(float loopTime)
Changes the amount of time this takes to loop through all colors, and also resets the current loop to its start.
|
void |
setColors(java.util.Collection<com.badlogic.gdx.graphics.Color> colors)
Sets the list of colors this uses to choose what color it draws with.
|
void |
setColors(com.badlogic.gdx.graphics.Color... colors)
Sets the list of colors this uses to choose what color it draws with.
|
computePrefSize, draw, getBitmapFontCache, getFontScaleX, getFontScaleY, getGlyphLayout, getLabelAlign, getLineAlign, getPrefHeight, getPrefWidth, getStyle, getText, getWrap, invalidate, layout, setAlignment, setAlignment, setEllipsis, setEllipsis, setFontScale, setFontScale, setFontScaleX, setFontScaleY, setStyle, setText, setText, setWrap, textEquals, toString
getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, invalidateHierarchy, needsLayout, pack, setFillParent, setLayoutEnabled, sizeChanged, validate
addAction, addCaptureListener, addListener, ancestorsVisible, ascendantsVisible, clear, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, drawDebug, drawDebugBounds, fire, firstAscendant, getActions, getCaptureListeners, 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, setSize, setStage, setTouchable, setUserObject, setVisible, setWidth, setX, setX, setY, setY, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFront
protected ColorChangeLabel()
public ColorChangeLabel(java.lang.CharSequence text, com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle style, java.util.Collection<com.badlogic.gdx.graphics.Color> colors)
text
- the text to display in this ColorChangeLabelstyle
- the LabelStyle to use for this; typically TextCellFactory handles thiscolors
- a Collection (usually a List) of Color, such as one returned by SquidColorCenter's gradient methodpublic ColorChangeLabel(java.lang.CharSequence text, com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle style, float loopTime, java.util.Collection<com.badlogic.gdx.graphics.Color> colors)
text
- the text to display in this ColorChangeLabelstyle
- the LabelStyle to use for this; typically TextCellFactory handles thisloopTime
- the amount of time, in seconds, it takes to loop through all the colors in the listcolors
- a Collection (usually a List) of Color, such as one returned by SquidColorCenter's gradient methodpublic ColorChangeLabel(java.lang.CharSequence text, com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle style, float loopTime, boolean doubleWidth, java.util.Collection<com.badlogic.gdx.graphics.Color> colors)
text
- the text to display in this ColorChangeLabelstyle
- the LabelStyle to use for this; typically TextCellFactory handles thisloopTime
- the amount of time, in seconds, it takes to loop through all the colors in the listdoubleWidth
- true if this takes up two grid cells; only matters if you use AnimatedEntity.setDirection(Direction)
colors
- a Collection (usually a List) of Color, such as one returned by SquidColorCenter's gradient methodpublic ColorChangeLabel(java.lang.CharSequence text, com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle style, com.badlogic.gdx.graphics.Color... colors)
text
- the text to display in this ColorChangeLabelstyle
- the LabelStyle to use for this; typically TextCellFactory handles thiscolors
- an array or vararg of Colorpublic ColorChangeLabel(java.lang.CharSequence text, com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle style, float loopTime, com.badlogic.gdx.graphics.Color... colors)
text
- the text to display in this ColorChangeLabelstyle
- the LabelStyle to use for this; typically TextCellFactory handles thisloopTime
- the amount of time, in seconds, it takes to loop through all the colors in the listcolors
- an array or vararg of Colorpublic ColorChangeLabel(java.lang.CharSequence text, com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle style, float loopTime, boolean doubleWidth, com.badlogic.gdx.graphics.Color... colors)
text
- the text to display in this ColorChangeLabelstyle
- the LabelStyle to use for this; typically TextCellFactory handles thisloopTime
- the amount of time, in seconds, it takes to loop through all the colors in the listdoubleWidth
- true if this takes up two grid cells; only matters if you use AnimatedEntity.setDirection(Direction)
colors
- an array or vararg of Colorpublic com.badlogic.gdx.graphics.Color getColor()
getColor
in class com.badlogic.gdx.scenes.scene2d.Actor
public void setColors(java.util.Collection<com.badlogic.gdx.graphics.Color> colors)
colors
- a Collection (usually a List) of Color, such as one returned by SquidColorCenter's gradient methodpublic void setColors(com.badlogic.gdx.graphics.Color... colors)
colors
- an array or vararg of Colorpublic void act(float delta)
Stage.act(float)
.
The default implementation calls
Action.act(float)
on each action and removes actions that are complete.
act
in class com.badlogic.gdx.scenes.scene2d.Actor
delta
- Time in seconds since the last frame.public void resetLoopTime(float loopTime)
loopTime
- the amount of time, in seconds, it takes to loop through all the colors in the listCopyright © Eben Howard 2012–2022. All rights reserved.