APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.scenes.scene2d.actions

public Class ColorAction

extends TemporalAction
Class Inheritance
Imports
com.badlogic.gdx.graphics.Color, com.badlogic.gdx.scenes.scene2d.Actor, com.badlogic.gdx.utils.Null

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

Modifier and TypeField and Description
private Color
private final Color
private float
private float
private float
private float

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
public Color
public Color
public void
reset()

Overrides com.badlogic.gdx.scenes.scene2d.actions.TemporalAction.reset.

Implements com.badlogic.gdx.utils.Pool.Poolable.reset.

Resets the optional state of this action to as if it were newly created, allowing the action to be pooled and reused.

public void
setColor(Color color)

Sets the color to modify.

public void
setEndColor(Color color)

Sets the color to transition to.

protected void
update(float percent)

Implements abstract com.badlogic.gdx.scenes.scene2d.actions.TemporalAction.update.

Called each frame.

Inherited from com.badlogic.gdx.scenes.scene2d.actions.TemporalAction:
actendfinishgetDurationgetInterpolationgetTimeisCompleteisReverserestartsetDurationsetInterpolationsetReversesetTime

Field Detail

colorback to summary
private Color color
Annotations
@Null
endback to summary
private final Color end
startAback to summary
private float startA
startBback to summary
private float startB
startGback to summary
private float startG
startRback to summary
private float startR

Constructor Detail

ColorActionback to summary
public ColorAction()

Method Detail

beginback to summary
protected void begin()

Overrides com.badlogic.gdx.scenes.scene2d.actions.TemporalAction.begin.

Doc from com.badlogic.gdx.scenes.scene2d.actions.TemporalAction.begin.

Called the first time act(float) is called. This is a good place to query the actor's starting state.

getColorback to summary
public Color getColor()
Annotations
@Null
getEndColorback to summary
public Color getEndColor()
resetback to summary
public void reset()

Overrides com.badlogic.gdx.scenes.scene2d.actions.TemporalAction.reset.

Implements com.badlogic.gdx.utils.Pool.Poolable.reset.

Doc from com.badlogic.gdx.scenes.scene2d.Action.reset.

Resets the optional state of this action to as if it were newly created, allowing the action to be pooled and reused. State required to be set for every usage of this action or computed during the action does not need to be reset.

The default implementation calls restart().

If a subclass has optional state, it must override this method, call super, and reset the optional state.

setColorback to summary
public void setColor(Color color)

Sets the color to modify. If null (the default), the actor's color will be used.

setEndColorback to summary
public void setEndColor(Color color)

Sets the color to transition to. Required.

updateback to summary
protected void update(float percent)

Implements abstract com.badlogic.gdx.scenes.scene2d.actions.TemporalAction.update.

Doc from com.badlogic.gdx.scenes.scene2d.actions.TemporalAction.update.

Called each frame.