Class PanelEffect.GlowBallEffect

java.lang.Object
com.badlogic.gdx.scenes.scene2d.Action
com.badlogic.gdx.scenes.scene2d.actions.TemporalAction
squidpony.squidgrid.gui.gdx.PanelEffect
squidpony.squidgrid.gui.gdx.PanelEffect.GlowBallEffect
All Implemented Interfaces:
com.badlogic.gdx.utils.Pool.Poolable
Enclosing class:
PanelEffect

public static class PanelEffect.GlowBallEffect
extends PanelEffect
  • Field Details

    • centers

      public Coord[] centers
      This will change over the course of the effect's duration, and includes 16 overlapping faint glowing areas.
    • end

      public Coord end
      Where the glow effect should travel towards as a whole.
    • radius

      public int radius
      Normally you should set this in the constructor, and not change it later.
    • color

      public float color
      The default glow ball color is medium-light blue.
    • lightMaps

      public double[][][] lightMaps
      The internal representation of how affected each cell is by the glow, based on proximity to center. This always has 16 light maps, but many will be identical and only calculated once.
    • affected

      public List<Coord> affected
      The raw list of Coords that might be affected by the glow; may include some cells that aren't going to show as glowing (it usually has some false positives), but shouldn't exclude any cells that should show as such (no false negatives). You can edit this if you need to, but it isn't recommended.
  • Constructor Details

    • GlowBallEffect

      public GlowBallEffect​(IPackedColorPanel targeting, Coord start, Coord end, int radius)
      Constructs a GlowBallEffect with explicit settings for some fields. The valid cells this can affect will be the full expanse of the IPackedColorPanel. The duration will be 1 second.
      Parameters:
      targeting - the IPackedColorPanel to affect
      start - the starting point for the glow ball(s)
      end - the ending point for the glow ball(s)
      radius - the radius of the explosion, in cells
    • GlowBallEffect

      public GlowBallEffect​(IPackedColorPanel targeting, float duration, Coord start, Coord end, int radius)
      Constructs a GlowBallEffect with explicit settings for some fields. The valid cells this can affect will be the full expanse of the IPackedColorPanel.
      Parameters:
      targeting - the IPackedColorPanel to affect
      duration - the duration of this PanelEffect in seconds, as a float
      start - the starting point for the glow ball(s)
      end - the ending point for the glow ball(s)
      radius - the radius of the explosion, in cells
    • GlowBallEffect

      public GlowBallEffect​(IPackedColorPanel targeting, float duration, GreasedRegion valid, Coord start, Coord end, int radius)
      Constructs a GlowBallEffect with explicit settings for some fields. The valid cells this can affect will be the full expanse of the IPackedColorPanel.
      Parameters:
      targeting - the IPackedColorPanel to affect
      duration - the duration of this PanelEffect in seconds, as a float
      valid - the valid cells that can be changed by this PanelEffect, as a GreasedRegion
      start - the starting point for the glow ball(s)
      end - the ending point for the glow ball(s)
      radius - the radius of the explosion, in cells
    • GlowBallEffect

      public GlowBallEffect​(IPackedColorPanel targeting, float duration, GreasedRegion valid, Coord start, Coord end, int radius, com.badlogic.gdx.graphics.Color coloring)
      Constructs a GlowBallEffect with explicit settings for some fields. The valid cells this can affect will be the full expanse of the IPackedColorPanel.
      Parameters:
      targeting - the IPackedColorPanel to affect
      duration - the duration of this PanelEffect in seconds, as a float
      valid - the valid cells that can be changed by this PanelEffect, as a GreasedRegion
      start - the starting point for the glow ball(s)
      end - the ending point for the glow ball(s)
      radius - the radius of the explosion, in cells
    • GlowBallEffect

      public GlowBallEffect​(IPackedColorPanel targeting, float duration, GreasedRegion valid, Coord start, Coord end, int radius, float coloring)
      Constructs a GlowBallEffect with explicit settings for some fields. The valid cells this can affect will be the full expanse of the IPackedColorPanel.
      Parameters:
      targeting - the IPackedColorPanel to affect
      duration - the duration of this PanelEffect in seconds, as a float
      valid - the valid cells that can be changed by this PanelEffect, as a GreasedRegion
      start - the starting point for the glow ball(s)
      end - the ending point for the glow ball(s)
      radius - the radius of the explosion, in cells
  • 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.