public class ColorChangeImage
extends com.badlogic.gdx.scenes.scene2d.ui.Image
Constructor and Description |
---|
ColorChangeImage(com.badlogic.gdx.graphics.Texture texture,
float loopTime,
boolean doubleWidth,
com.badlogic.gdx.graphics.Color... colors)
Creates an image stretched and aligned center, that will use the specified list of colors.
|
ColorChangeImage(com.badlogic.gdx.graphics.Texture texture,
float loopTime,
boolean doubleWidth,
float width,
float height,
com.badlogic.gdx.graphics.Color... colors)
Creates an image stretched and aligned center, that will use the specified list of colors.
|
ColorChangeImage(com.badlogic.gdx.graphics.Texture texture,
float loopTime,
boolean doubleWidth,
float width,
float height,
java.util.List<com.badlogic.gdx.graphics.Color> colors)
Creates an image stretched and aligned center, that will use the specified list of colors.
|
ColorChangeImage(com.badlogic.gdx.graphics.Texture texture,
float loopTime,
boolean doubleWidth,
java.util.List<com.badlogic.gdx.graphics.Color> colors)
Creates an image stretched and aligned center, that will use the specified list of colors.
|
ColorChangeImage(com.badlogic.gdx.graphics.Texture texture,
float loopTime,
com.badlogic.gdx.graphics.Color... colors)
Creates an image stretched and aligned center, that will use the specified list of colors.
|
ColorChangeImage(com.badlogic.gdx.graphics.Texture texture,
float loopTime,
java.util.List<com.badlogic.gdx.graphics.Color> colors)
Creates an image stretched and aligned center, that will use the specified list of colors.
|
ColorChangeImage(com.badlogic.gdx.graphics.Texture texture,
java.util.List<com.badlogic.gdx.graphics.Color> colors)
Creates an image stretched and aligned center, that will use the specified list of colors.
|
ColorChangeImage(com.badlogic.gdx.graphics.g2d.TextureRegion texture,
float loopTime,
boolean doubleWidth,
com.badlogic.gdx.graphics.Color... colors)
Creates an image stretched and aligned center, that will use the specified list of colors.
|
ColorChangeImage(com.badlogic.gdx.graphics.g2d.TextureRegion texture,
float loopTime,
boolean doubleWidth,
float width,
float height,
com.badlogic.gdx.graphics.Color... colors)
Creates an image stretched and aligned center, that will use the specified list of colors.
|
ColorChangeImage(com.badlogic.gdx.graphics.g2d.TextureRegion texture,
float loopTime,
boolean doubleWidth,
float width,
float height,
java.util.List<com.badlogic.gdx.graphics.Color> colors)
Creates an image stretched and aligned center, that will use the specified list of colors.
|
ColorChangeImage(com.badlogic.gdx.graphics.g2d.TextureRegion texture,
float loopTime,
boolean doubleWidth,
java.util.List<com.badlogic.gdx.graphics.Color> colors)
Creates an image stretched and aligned center, that will use the specified list of colors.
|
ColorChangeImage(com.badlogic.gdx.graphics.g2d.TextureRegion texture,
float loopTime,
com.badlogic.gdx.graphics.Color... colors)
Creates an image stretched and aligned center, that will use the specified list of colors.
|
ColorChangeImage(com.badlogic.gdx.graphics.g2d.TextureRegion texture,
float loopTime,
java.util.List<com.badlogic.gdx.graphics.Color> colors)
Creates an image stretched and aligned center, that will use the specified list of colors.
|
ColorChangeImage(com.badlogic.gdx.graphics.g2d.TextureRegion texture,
java.util.List<com.badlogic.gdx.graphics.Color> colors)
Creates an image stretched and aligned center, that will use the specified list of colors.
|
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(com.badlogic.gdx.graphics.Color... colors)
Sets the list of colors this uses to choose what color it draws with.
|
void |
setColors(java.util.List<com.badlogic.gdx.graphics.Color> colors)
Sets the list of colors this uses to choose what color it draws with.
|
draw, getAlign, getDrawable, getImageHeight, getImageWidth, getImageX, getImageY, getMinHeight, getMinWidth, getPrefHeight, getPrefWidth, layout, setAlign, setDrawable, setDrawable, setScaling, toString
getMaxHeight, getMaxWidth, invalidate, 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
public ColorChangeImage(com.badlogic.gdx.graphics.Texture texture, java.util.List<com.badlogic.gdx.graphics.Color> colors)
texture
- the texture to usecolors
- a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methodspublic ColorChangeImage(com.badlogic.gdx.graphics.Texture texture, float loopTime, java.util.List<com.badlogic.gdx.graphics.Color> colors)
texture
- the texture to useloopTime
- the amount of time, in seconds, to spend transitioning through the colors before repeatingcolors
- a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methodspublic ColorChangeImage(com.badlogic.gdx.graphics.Texture texture, float loopTime, boolean doubleWidth, java.util.List<com.badlogic.gdx.graphics.Color> colors)
texture
- the texture to useloopTime
- the amount of time, in seconds, to spend transitioning through the colors before repeatingdoubleWidth
- true if this takes up two grid cells; only matters if you use AnimatedEntity.setDirection(Direction)
colors
- a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methodspublic ColorChangeImage(com.badlogic.gdx.graphics.Texture texture, float loopTime, boolean doubleWidth, float width, float height, java.util.List<com.badlogic.gdx.graphics.Color> colors)
texture
- the texture to useloopTime
- the amount of time, in seconds, to spend transitioning through the colors before repeatingdoubleWidth
- true if this takes up two grid cells; only matters if you use AnimatedEntity.setDirection(Direction)
colors
- a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methodspublic ColorChangeImage(com.badlogic.gdx.graphics.Texture texture, float loopTime, com.badlogic.gdx.graphics.Color... colors)
texture
- the texture to useloopTime
- the amount of time, in seconds, to spend transitioning through the colors before repeatingcolors
- a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methodspublic ColorChangeImage(com.badlogic.gdx.graphics.Texture texture, float loopTime, boolean doubleWidth, com.badlogic.gdx.graphics.Color... colors)
texture
- the texture to useloopTime
- the amount of time, in seconds, to spend transitioning through the colors before repeatingdoubleWidth
- true if this takes up two grid cells; only matters if you use AnimatedEntity.setDirection(Direction)
colors
- a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methodspublic ColorChangeImage(com.badlogic.gdx.graphics.Texture texture, float loopTime, boolean doubleWidth, float width, float height, com.badlogic.gdx.graphics.Color... colors)
texture
- the texture to useloopTime
- the amount of time, in seconds, to spend transitioning through the colors before repeatingdoubleWidth
- true if this takes up two grid cells; only matters if you use AnimatedEntity.setDirection(Direction)
colors
- a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methodspublic ColorChangeImage(com.badlogic.gdx.graphics.g2d.TextureRegion texture, java.util.List<com.badlogic.gdx.graphics.Color> colors)
texture
- the texture to usecolors
- a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methodspublic ColorChangeImage(com.badlogic.gdx.graphics.g2d.TextureRegion texture, float loopTime, java.util.List<com.badlogic.gdx.graphics.Color> colors)
texture
- the texture to useloopTime
- the amount of time, in seconds, to spend transitioning through the colors before repeatingcolors
- a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methodspublic ColorChangeImage(com.badlogic.gdx.graphics.g2d.TextureRegion texture, float loopTime, boolean doubleWidth, java.util.List<com.badlogic.gdx.graphics.Color> colors)
texture
- the texture to useloopTime
- the amount of time, in seconds, to spend transitioning through the colors before repeatingdoubleWidth
- true if this takes up two grid cells; only matters if you use AnimatedEntity.setDirection(Direction)
colors
- a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methodspublic ColorChangeImage(com.badlogic.gdx.graphics.g2d.TextureRegion texture, float loopTime, boolean doubleWidth, float width, float height, java.util.List<com.badlogic.gdx.graphics.Color> colors)
texture
- the texture to useloopTime
- the amount of time, in seconds, to spend transitioning through the colors before repeatingdoubleWidth
- true if this takes up two grid cells; only matters if you use AnimatedEntity.setDirection(Direction)
colors
- a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methodspublic ColorChangeImage(com.badlogic.gdx.graphics.g2d.TextureRegion texture, float loopTime, com.badlogic.gdx.graphics.Color... colors)
texture
- the texture to useloopTime
- the amount of time, in seconds, to spend transitioning through the colors before repeatingcolors
- a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methodspublic ColorChangeImage(com.badlogic.gdx.graphics.g2d.TextureRegion texture, float loopTime, boolean doubleWidth, com.badlogic.gdx.graphics.Color... colors)
texture
- the texture to useloopTime
- the amount of time, in seconds, to spend transitioning through the colors before repeatingdoubleWidth
- true if this takes up two grid cells; only matters if you use AnimatedEntity.setDirection(Direction)
colors
- a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methodspublic ColorChangeImage(com.badlogic.gdx.graphics.g2d.TextureRegion texture, float loopTime, boolean doubleWidth, float width, float height, com.badlogic.gdx.graphics.Color... colors)
texture
- the texture to useloopTime
- the amount of time, in seconds, to spend transitioning through the colors before repeatingdoubleWidth
- true if this takes up two grid cells; only matters if you use AnimatedEntity.setDirection(Direction)
colors
- a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methodspublic com.badlogic.gdx.graphics.Color getColor()
getColor
in class com.badlogic.gdx.scenes.scene2d.Actor
public void setColors(java.util.List<com.badlogic.gdx.graphics.Color> colors)
colors
- a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methodspublic 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.