Package squidpony.squidgrid.gui.gdx
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
-
Nested Class Summary
Nested classes/interfaces inherited from class squidpony.squidgrid.gui.gdx.PanelEffect
PanelEffect.ExplosionEffect, PanelEffect.GibberishEffect, PanelEffect.GlowBallEffect, PanelEffect.ProjectileEffect, PanelEffect.PulseEffect, PanelEffect.SteadyProjectileEffect
-
Field Summary
Fields Modifier and Type Field Description 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).Coord[]
centers
This will change over the course of the effect's duration, and includes 16 overlapping faint glowing areas.float
color
The default glow ball color is medium-light blue.Coord
end
Where the glow effect should travel towards as a whole.double[][][]
lightMaps
The internal representation of how affected each cell is by the glow, based on proximity to center.int
radius
Normally you should set this in the constructor, and not change it later.Fields inherited from class squidpony.squidgrid.gui.gdx.PanelEffect
fastInSlowMidFastOut, target, validCells
-
Constructor Summary
Constructors Constructor Description GlowBallEffect(IPackedColorPanel targeting, float duration, Coord start, Coord end, int radius)
Constructs a GlowBallEffect with explicit settings for some fields.GlowBallEffect(IPackedColorPanel targeting, float duration, GreasedRegion valid, Coord start, Coord end, int radius)
Constructs a GlowBallEffect with explicit settings for some fields.GlowBallEffect(IPackedColorPanel targeting, float duration, GreasedRegion valid, Coord start, Coord end, int radius, float coloring)
Constructs a GlowBallEffect with explicit settings for some fields.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.GlowBallEffect(IPackedColorPanel targeting, Coord start, Coord end, int radius)
Constructs a GlowBallEffect with explicit settings for some 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
-
Field Details
-
centers
This will change over the course of the effect's duration, and includes 16 overlapping faint glowing areas. -
end
Where the glow effect should travel towards as a whole. -
radius
Normally you should set this in the constructor, and not change it later. -
color
The default glow ball color is medium-light blue. -
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
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
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 affectstart
- 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 affectduration
- the duration of this PanelEffect in seconds, as a floatstart
- 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 affectduration
- the duration of this PanelEffect in seconds, as a floatvalid
- the valid cells that can be changed by this PanelEffect, as a GreasedRegionstart
- 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 affectduration
- the duration of this PanelEffect in seconds, as a floatvalid
- the valid cells that can be changed by this PanelEffect, as a GreasedRegionstart
- 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 affectduration
- the duration of this PanelEffect in seconds, as a floatvalid
- the valid cells that can be changed by this PanelEffect, as a GreasedRegionstart
- 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
Called each frame.- Specified by:
update
in 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.
-