public class ColorChangeImage extends com.badlogic.gdx.scenes.scene2d.ui.Image
Constructor and Description |
---|
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,
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,
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(List<com.badlogic.gdx.graphics.Color> colors)
Sets the list of colors this uses to choose what color it draws with.
|
draw, getDrawable, getImageHeight, getImageWidth, getImageX, getImageY, getMinHeight, getMinWidth, getPrefHeight, getPrefWidth, layout, setAlign, setDrawable, setDrawable, setScaling
getMaxHeight, getMaxWidth, invalidate, invalidateHierarchy, needsLayout, pack, setFillParent, setLayoutEnabled, sizeChanged, validate
addAction, addCaptureListener, addListener, clear, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, drawDebug, drawDebugBounds, fire, getActions, getCaptureListeners, getDebug, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getWidth, getX, getX, getY, getY, getZIndex, hasActions, hasParent, hit, isAscendantOf, isDescendantOf, isTouchable, isVisible, localToAscendantCoordinates, localToParentCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, positionChanged, remove, removeAction, removeCaptureListener, removeListener, rotateBy, rotationChanged, scaleBy, scaleBy, 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, setY, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFront, toString
public ColorChangeImage(com.badlogic.gdx.graphics.Texture texture, 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, 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, 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 com.badlogic.gdx.graphics.Color getColor()
getColor
in class com.badlogic.gdx.scenes.scene2d.Actor
public void setColors(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 © 2012–2016. All rights reserved.