Class GridAction.TintAction
java.lang.Object
com.badlogic.gdx.scenes.scene2d.Action
com.badlogic.gdx.scenes.scene2d.actions.TemporalAction
com.github.yellowstonegames.glyph.GridAction
com.github.yellowstonegames.glyph.GridAction.TintAction
- All Implemented Interfaces:
com.badlogic.gdx.scenes.scene2d.actions.FinishableAction, com.badlogic.gdx.utils.Pool.Poolable
- Enclosing class:
GridAction
Changes the color tint of one or more cells on a GlyphGrid for some amount of time.
-
Nested Class Summary
Nested classes/interfaces inherited from class GridAction
GridAction.CloudAction, GridAction.ExplosionAction, GridAction.GibberishAction, GridAction.PulseAction, GridAction.TintAction -
Field Summary
FieldsModifier and TypeFieldDescriptionList<com.github.yellowstonegames.grid.Coord> The raw list of Coords that might be affected by the action.int[][]A 2D array of what RGBA8888 colors to tint what cells; alpha is used to determine how much each cell is affected.Fields inherited from class GridAction
grid, GUI_RANDOM, validFields inherited from class com.badlogic.gdx.scenes.scene2d.Action
actor, target -
Constructor Summary
ConstructorsConstructorDescriptionTintAction(GlyphGrid targeting, float duration, com.github.yellowstonegames.grid.Region valid, int[][] colorGrid) Constructs an TintAction with explicit settings for most fields. -
Method Summary
Methods inherited from class com.badlogic.gdx.scenes.scene2d.actions.TemporalAction
act, begin, end, finish, getDuration, getInterpolation, getTime, isComplete, isReverse, reset, restart, setDuration, setInterpolation, setReverse, setTimeMethods inherited from class com.badlogic.gdx.scenes.scene2d.Action
getActor, getPool, getTarget, setActor, setPool, setTarget, toString
-
Field Details
-
colorGrid
public int[][] colorGridA 2D array of what RGBA8888 colors to tint what cells; alpha is used to determine how much each cell is affected. If an int color is 0, then it is fully transparent, and that cell won't change. -
affected
The raw list of Coords that might be affected by the action. You can edit this if you need to, but it isn't recommended.
-
-
Constructor Details
-
TintAction
public TintAction(GlyphGrid targeting, float duration, com.github.yellowstonegames.grid.Region valid, int[][] colorGrid) Constructs an TintAction with explicit settings for most fields.- Parameters:
targeting- the GlyphGrid to affectduration- the duration of this GridAction in seconds, as a floatvalid- the valid cells that can be changed by this GridAction, as a RegioncolorGrid- a 2D array of RGBA8888 int colors that will be used to determine how to tint cells; alpha affects how strong the tint will be
-
-
Method Details
-
update
protected void update(float percent) Called each frame.- Specified by:
updatein classcom.badlogic.gdx.scenes.scene2d.actions.TemporalAction- Parameters:
percent- The percentage of completion for this action, growing from 0 to 1 over the duration. Ifreversed, this will shrink from 1 to 0.
-