|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.newdawn.slick.particles.ConfigurableEmitter
public class ConfigurableEmitter
An emitter than can be externally configured. This configuration can also be saved/loaded using the ParticleIO class.
ParticleIO
Nested Class Summary | |
---|---|
class |
ConfigurableEmitter.ColorRecord
A single element in the colour range of this emitter |
class |
ConfigurableEmitter.LinearInterpolator
A value computed based on linear interpolation between a set of points |
class |
ConfigurableEmitter.RandomValue
A configurable simple linear random value |
class |
ConfigurableEmitter.Range
A simple bean describing a range of values |
class |
ConfigurableEmitter.SimpleValue
A configurable simple single value |
static interface |
ConfigurableEmitter.Value
a general interface to provide a general value :] |
Field Summary | |
---|---|
protected boolean |
adjust
True if we need to adjust particles for movement |
protected float |
adjustx
The amount to adjust on the x axis |
protected float |
adjusty
The amount to adjust on the y axis |
ConfigurableEmitter.LinearInterpolator |
alpha
Whiskas - Interpolated value for alpha |
ConfigurableEmitter.SimpleValue |
angularOffset
The angular offset |
java.util.ArrayList |
colors
The color range |
protected boolean |
completed
True if the system has completed due to a wrap up |
ConfigurableEmitter.Range |
emitCount
The number of particles that will be emitted |
ConfigurableEmitter.SimpleValue |
endAlpha
The ending alpha value |
ConfigurableEmitter.SimpleValue |
gravityFactor
The factor of gravity to apply |
ConfigurableEmitter.SimpleValue |
growthFactor
The growth factor on the particles |
java.lang.String |
imageName
The name of the image in use |
ConfigurableEmitter.Range |
initialDistance
The initial distance of the particles |
ConfigurableEmitter.Range |
initialLife
The initial life of the new pixels |
ConfigurableEmitter.Range |
initialSize
The initial size of the new pixels |
ConfigurableEmitter.Range |
length
The length of the effect |
java.lang.String |
name
The name attribute |
ConfigurableEmitter.LinearInterpolator |
scaleY
Whiskas - Interpolated value for y axis scaling |
ConfigurableEmitter.LinearInterpolator |
size
Whiskas - Interpolated value for size |
ConfigurableEmitter.Range |
spawnCount
The spawn count property - how many particles are spawned each time |
ConfigurableEmitter.Range |
spawnInterval
The spawn interval range property - how often spawn happens |
ConfigurableEmitter.Range |
speed
The speed particles fly out |
ConfigurableEmitter.RandomValue |
spread
The spread of the particles |
ConfigurableEmitter.SimpleValue |
startAlpha
The starting alpha value |
boolean |
useAdditive
True if the additivie blending mode should be used for particles owned by this emitter |
boolean |
useOriented
True if the quads should be orieted based on velocity |
int |
usePoints
The points indicate |
ConfigurableEmitter.LinearInterpolator |
velocity
Whiskas - Interpolated value for velocity |
ConfigurableEmitter.SimpleValue |
windFactor
The factor of wind to apply |
protected boolean |
wrapUp
True if we're wrapping up |
ConfigurableEmitter.Range |
xOffset
The offset from the x position |
ConfigurableEmitter.Range |
yOffset
The offset from the y position |
Constructor Summary | |
---|---|
ConfigurableEmitter(java.lang.String name)
Create a new emitter configurable externally |
Method Summary | |
---|---|
void |
addColorPoint(float pos,
Color col)
Add a point in the colour cycle |
boolean |
completed()
Check if this emitter has completed it's cycle |
ConfigurableEmitter |
duplicate()
Create a duplicate of this emitter. |
Image |
getImage()
Get the image to draw for each particle |
java.lang.String |
getImageName()
The name of the image to load |
float |
getX()
Get the base x coordiante for spawning particles |
float |
getY()
Get the base y coordiante for spawning particles |
boolean |
isEnabled()
Check if the emitter is enabled |
boolean |
isOriented()
Check if the particles produced should maintain orientation |
void |
replay()
Cause the emitter to replay it's circle |
void |
replayCheck()
Check if the replay has died out - used by the editor |
void |
reset()
Release all the particles held by this emitter |
void |
resetState()
Clear the state of emitter back to default |
void |
setEnabled(boolean enabled)
Indicate whether the emitter should be enabled |
void |
setImageName(java.lang.String imageName)
Set the name of the image to use on a per particle basis. |
void |
setPosition(float x,
float y)
Set the position of this particle source |
void |
setPosition(float x,
float y,
boolean moveParticles)
Set the position of this particle source |
static void |
setRelativePath(java.lang.String path)
Set the path from which images should be loaded |
java.lang.String |
toString()
|
void |
update(ParticleSystem system,
int delta)
Update the emitter, produce any particles required by requesting them from the particle system provided. |
void |
updateParticle(Particle particle,
int delta)
Update a single particle that this emitter produced |
boolean |
useAdditive()
Check if this emitter should use additive blending |
boolean |
usePoints(ParticleSystem system)
Check if this emitter should use points based on it's own settings and those of the particle system |
void |
wrapUp()
Wrap up the particle emitter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public ConfigurableEmitter.Range spawnInterval
public ConfigurableEmitter.Range spawnCount
public ConfigurableEmitter.Range initialLife
public ConfigurableEmitter.Range initialSize
public ConfigurableEmitter.Range xOffset
public ConfigurableEmitter.Range yOffset
public ConfigurableEmitter.RandomValue spread
public ConfigurableEmitter.SimpleValue angularOffset
public ConfigurableEmitter.Range initialDistance
public ConfigurableEmitter.Range speed
public ConfigurableEmitter.SimpleValue growthFactor
public ConfigurableEmitter.SimpleValue gravityFactor
public ConfigurableEmitter.SimpleValue windFactor
public ConfigurableEmitter.Range length
public java.util.ArrayList colors
ConfigurableEmitter.ColorRecord
public ConfigurableEmitter.SimpleValue startAlpha
public ConfigurableEmitter.SimpleValue endAlpha
public ConfigurableEmitter.LinearInterpolator alpha
public ConfigurableEmitter.LinearInterpolator size
public ConfigurableEmitter.LinearInterpolator velocity
public ConfigurableEmitter.LinearInterpolator scaleY
public ConfigurableEmitter.Range emitCount
public int usePoints
public boolean useOriented
public boolean useAdditive
public java.lang.String name
public java.lang.String imageName
protected boolean wrapUp
protected boolean completed
protected boolean adjust
protected float adjustx
protected float adjusty
Constructor Detail |
---|
public ConfigurableEmitter(java.lang.String name)
name
- The name of emitterMethod Detail |
---|
public static void setRelativePath(java.lang.String path)
path
- The path from which images should be loadedpublic void setImageName(java.lang.String imageName)
imageName
- The name of the image to use on a per particle referencesetRelativePath(String)
public java.lang.String getImageName()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public void setPosition(float x, float y)
x
- The x coodinate of that this emitter should spawn aty
- The y coodinate of that this emitter should spawn atpublic void setPosition(float x, float y, boolean moveParticles)
x
- The x coodinate of that this emitter should spawn aty
- The y coodinate of that this emitter should spawn atmoveParticles
- True if particles should be moved with the emitterpublic float getX()
public float getY()
public boolean isEnabled()
ParticleEmitter
isEnabled
in interface ParticleEmitter
ParticleEmitter.isEnabled()
public void setEnabled(boolean enabled)
ParticleEmitter
setEnabled
in interface ParticleEmitter
enabled
- True if the emitter should be enabledParticleEmitter.setEnabled(boolean)
public void update(ParticleSystem system, int delta)
ParticleEmitter
update
in interface ParticleEmitter
system
- The particle system used to create particlesdelta
- The amount of time in milliseconds since last emitter updateParticleEmitter.update(org.newdawn.slick.particles.ParticleSystem,
int)
public void updateParticle(Particle particle, int delta)
ParticleEmitter
updateParticle
in interface ParticleEmitter
particle
- The particle to be updateddelta
- The amount of time in millisecond since last particle updateParticleEmitter.updateParticle(org.newdawn.slick.particles.Particle,
int)
public boolean completed()
completed
in interface ParticleEmitter
public void replay()
public void reset()
public void replayCheck()
public ConfigurableEmitter duplicate()
public void addColorPoint(float pos, Color col)
pos
- The position in the life cycle (0 = start, 1 = end)col
- The color applied at this positionpublic boolean useAdditive()
ParticleEmitter
useAdditive
in interface ParticleEmitter
public boolean isOriented()
ParticleEmitter
isOriented
in interface ParticleEmitter
public boolean usePoints(ParticleSystem system)
ParticleEmitter
usePoints
in interface ParticleEmitter
system
- The particle system to cross check agianst
public Image getImage()
ParticleEmitter
getImage
in interface ParticleEmitter
public void wrapUp()
ParticleEmitter
wrapUp
in interface ParticleEmitter
public void resetState()
ParticleEmitter
resetState
in interface ParticleEmitter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |