Package squidpony.squidgrid.gui.gdx
Class PackedColorAction
java.lang.Object
com.badlogic.gdx.scenes.scene2d.Action
com.badlogic.gdx.scenes.scene2d.actions.TemporalAction
squidpony.squidgrid.gui.gdx.PackedColorAction
- All Implemented Interfaces:
com.badlogic.gdx.utils.Pool.Poolable
public class PackedColorAction extends com.badlogic.gdx.scenes.scene2d.actions.TemporalAction
Sets the actor's color (or a specified color), from the current to the new color. Note this action transitions from the color
at the time the action starts to the specified color.
- Author:
- Nathan Sweet
-
Field Summary
-
Constructor Summary
Constructors Constructor Description PackedColorAction()
-
Method Summary
Modifier and Type Method Description protected void
begin()
static PackedColorAction
color(float color)
Sets the actor's color instantly.static PackedColorAction
color(float color, float duration)
Transitions from the color at the time this action starts to the specified color.static PackedColorAction
color(float color, float duration, com.badlogic.gdx.math.Interpolation interpolation)
Transitions from the color at the time this action starts to the specified color.com.badlogic.gdx.graphics.Color
getColor()
float
getEndColor()
void
reset()
void
setColor(com.badlogic.gdx.graphics.Color color)
Sets the color to modify.void
setEndColor(float color)
Sets the color to transition to.protected void
update(float percent)
Methods inherited from class com.badlogic.gdx.scenes.scene2d.actions.TemporalAction
act, end, finish, getDuration, getInterpolation, getTime, isComplete, isReverse, restart, setDuration, setInterpolation, setReverse, setTime
-
Constructor Details
-
PackedColorAction
public PackedColorAction()
-
-
Method Details
-
begin
- Overrides:
begin
in classcom.badlogic.gdx.scenes.scene2d.actions.TemporalAction
-
update
- Specified by:
update
in classcom.badlogic.gdx.scenes.scene2d.actions.TemporalAction
-
reset
- Specified by:
reset
in interfacecom.badlogic.gdx.utils.Pool.Poolable
- Overrides:
reset
in classcom.badlogic.gdx.scenes.scene2d.actions.TemporalAction
-
getColor
-
setColor
Sets the color to modify. If null (the default), theactor's
color
will be used. -
getEndColor
-
setEndColor
Sets the color to transition to. Required. -
color
Sets the actor's color instantly. -
color
Transitions from the color at the time this action starts to the specified color. -
color
public static PackedColorAction color(float color, float duration, com.badlogic.gdx.math.Interpolation interpolation)Transitions from the color at the time this action starts to the specified color.
-