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

public static class GridAction.TintAction extends GridAction
Changes the color tint of one or more cells on a GlyphGrid for some amount of time.
  • Nested Class Summary

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    List<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, valid

    Fields inherited from class com.badlogic.gdx.scenes.scene2d.Action

    actor, target
  • Constructor Summary

    Constructors
    Constructor
    Description
    TintAction(GlyphGrid targeting, float duration, com.github.yellowstonegames.grid.Region valid, int[][] colorGrid)
    Constructs an TintAction with explicit settings for most fields.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    update(float percent)
    Called each frame.

    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, setTime

    Methods inherited from class com.badlogic.gdx.scenes.scene2d.Action

    getActor, getPool, getTarget, setActor, setPool, setTarget, toString

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • colorGrid

      public int[][] colorGrid
      A 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

      public List<com.github.yellowstonegames.grid.Coord> 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 affect
      duration - the duration of this GridAction in seconds, as a float
      valid - the valid cells that can be changed by this GridAction, as a Region
      colorGrid - 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:
      update in class com.badlogic.gdx.scenes.scene2d.actions.TemporalAction
      Parameters:
      percent - The percentage of completion for this action, growing from 0 to 1 over the duration. If reversed, this will shrink from 1 to 0.