public class Radiance
extends java.lang.Object
implements java.io.Serializable
flare
variable to some value between 0.0f and 1.0f to temporarily expand the minimum radius
for strobe and/or flare, useful for gameplay-dependent brightening of a Radiance.
Modifier and Type | Field and Description |
---|---|
float |
color
The color of light as a float; typically opaque and lighter than the glowing object's symbol.
|
float |
delay
A time delay that applies to when the strobe and flicker effects change; useful with strobe to make a strobe
expand its lit radius at one point, then expand at a slightly later time at another Radiance with a delay.
|
float |
flare
A temporary increase to the minimum radiance range, meant to brighten a glow during an effect.
|
float |
flicker
The rate of random continuous change to radiance range, like the light from a campfire.
|
float |
range
How far the radiated light extends; 0f is "just this cell", anything higher can go into neighboring cells.
|
float |
strobe
The rate of non-random continuous change to radiance range, like a mechanical strobe effect.
|
Constructor and Description |
---|
Radiance()
All-default constructor; makes a single-cell unchanging white light.
|
Radiance(float range)
Makes an unchanging white light with the specified range in cells.
|
Radiance(float range,
com.badlogic.gdx.graphics.Color color,
float flicker,
float strobe)
Makes a flickering light with the given color (as a libGDX Color) and the specified range in cells; the flicker
parameter affects the rate at which this will randomly reduce its range and return to normal, and the strobe
parameter affects the rate at which this will steadily reduce its range and return to normal.
|
Radiance(float range,
float color)
Makes an unchanging light with the given color (as a packed float) and the specified range in cells.
|
Radiance(float range,
float color,
float flicker)
Makes a flickering light with the given color (as a packed float) and the specified range in cells; the flicker
parameter affects the rate at which this will randomly reduce its range and return to normal.
|
Radiance(float range,
float color,
float flicker,
float strobe)
Makes a flickering light with the given color (as a packed float) and the specified range in cells; the flicker
parameter affects the rate at which this will randomly reduce its range and return to normal, and the strobe
parameter affects the rate at which this will steadily reduce its range and return to normal.
|
Radiance(float range,
float color,
float flicker,
float strobe,
float delay)
Makes a flickering light with the given color (as a packed float) and the specified range in cells; the flicker
parameter affects the rate at which this will randomly reduce its range and return to normal, and the strobe
parameter affects the rate at which this will steadily reduce its range and return to normal.
|
Radiance(float range,
float color,
float flicker,
float strobe,
float delay,
float flare)
Makes a flickering light with the given color (as a packed float) and the specified range in cells; the flicker
parameter affects the rate at which this will randomly reduce its range and return to normal, and the strobe
parameter affects the rate at which this will steadily reduce its range and return to normal.
|
Radiance(Radiance other)
Copies another Radiance exactly, except for the pattern its flicker may have, if any.
|
Modifier and Type | Method and Description |
---|---|
float |
currentRange()
Provides the calculated current range adjusted for flicker and strobe at the current time in milliseconds, with
flicker seeded with the identity hash code of this Radiance.
|
static Radiance |
deserializeFromString(java.lang.String data) |
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
static Radiance[] |
makeChain(int length,
float range,
float color,
float strobe)
Makes a chain of Radiance objects that will pulse in a sequence, expanding from one to the next.
|
java.lang.String |
serializeToString() |
java.lang.String |
toString() |
public float range
public float color
public float flicker
System.identityHashCode(Object)
of this Radiance, which will probably
make all flicker effects different when flicker is non-0.public float strobe
public float delay
public float flare
public Radiance()
public Radiance(float range)
range
- possibly-non-integer radius to light, in cellspublic Radiance(float range, float color)
range
- possibly-non-integer radius to light, in cellscolor
- packed float color, as produced by Color.toFloatBits()
public Radiance(float range, float color, float flicker)
range
- possibly-non-integer radius to light, in cellscolor
- packed float color, as produced by Color.toFloatBits()
flicker
- the rate at which to flicker, as a non-negative floatpublic Radiance(float range, float color, float flicker, float strobe)
range
- possibly-non-integer radius to light, in cellscolor
- packed float color, as produced by Color.toFloatBits()
flicker
- the rate at which to flicker, as a non-negative floatstrobe
- the rate at which to strobe or pulse, as a non-negative floatpublic Radiance(float range, com.badlogic.gdx.graphics.Color color, float flicker, float strobe)
range
- possibly-non-integer radius to light, in cellscolor
- a libGDX Color object; will not be modifiedflicker
- the rate at which to flicker, as a non-negative floatstrobe
- the rate at which to strobe or pulse, as a non-negative floatpublic Radiance(float range, float color, float flicker, float strobe, float delay)
range
- possibly-non-integer radius to light, in cellscolor
- packed float color, as produced by Color.toFloatBits()
flicker
- the rate at which to flicker, as a non-negative floatstrobe
- the rate at which to strobe or pulse, as a non-negative floatdelay
- a delay applied to the "high points" and "low points" of strobe and flicker, from 0f to 1fpublic Radiance(float range, float color, float flicker, float strobe, float delay, float flare)
range
- possibly-non-integer radius to light, in cellscolor
- packed float color, as produced by Color.toFloatBits()
flicker
- the rate at which to flicker, as a non-negative floatstrobe
- the rate at which to strobe or pulse, as a non-negative floatdelay
- a delay applied to the "high points" and "low points" of strobe and flicker, from 0f to 1fflare
- affects the minimum radius for the Radiance, from 0f to 1f with a default of 0fpublic Radiance(Radiance other)
other
- another Radiance to copypublic float currentRange()
public static Radiance[] makeChain(int length, float range, float color, float strobe)
length
- how many Radiance objects should be in the returned arrayrange
- in cells, how far each Radiance should expand from its start at its greatest radiuscolor
- as a packed float colorstrobe
- the rate at which the chain will pulse; should be greater than 0public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String serializeToString()
public static Radiance deserializeFromString(java.lang.String data)
Copyright © Eben Howard 2012–2022. All rights reserved.