public class ParticleEffect extends Object implements Disposable
Constructor and Description |
---|
ParticleEffect() |
ParticleEffect(ParticleEffect effect) |
Modifier and Type | Method and Description |
---|---|
void |
allowCompletion() |
void |
dispose()
Disposes the texture for each sprite for each ParticleEmitter.
|
void |
draw(Batch spriteBatch) |
void |
draw(Batch spriteBatch,
float delta) |
ParticleEmitter |
findEmitter(String name)
Returns the emitter with the specified name, or null.
|
void |
flipY() |
BoundingBox |
getBoundingBox()
Returns the bounding box for all active particles.
|
Array<ParticleEmitter> |
getEmitters() |
boolean |
isComplete() |
void |
load(FileHandle effectFile,
FileHandle imagesDir) |
void |
load(FileHandle effectFile,
TextureAtlas atlas) |
void |
load(FileHandle effectFile,
TextureAtlas atlas,
String atlasPrefix) |
void |
loadEmitterImages(FileHandle imagesDir) |
void |
loadEmitterImages(TextureAtlas atlas) |
void |
loadEmitterImages(TextureAtlas atlas,
String atlasPrefix) |
void |
loadEmitters(FileHandle effectFile) |
void |
preAllocateParticles()
Allocates all emitters particles.
|
void |
reset()
Resets the effect so it can be started again like a new effect.
|
void |
reset(boolean resetScaling)
Resets the effect so it can be started again like a new effect.
|
void |
save(Writer output) |
void |
scaleEffect(float scaleFactor)
Permanently scales all the size and motion parameters of all the emitters in this effect.
|
void |
scaleEffect(float scaleFactor,
float motionScaleFactor)
Permanently scales all the size and motion parameters of all the emitters in this effect.
|
void |
scaleEffect(float xSizeScaleFactor,
float ySizeScaleFactor,
float motionScaleFactor)
Permanently scales all the size and motion parameters of all the emitters in this effect.
|
void |
setDuration(int duration) |
void |
setEmittersCleanUpBlendFunction(boolean cleanUpBlendFunction)
Sets the
cleansUpBlendFunction
parameter on all ParticleEmitters currently in this ParticleEffect. |
void |
setFlip(boolean flipX,
boolean flipY) |
void |
setPosition(float x,
float y) |
void |
start() |
void |
update(float delta) |
public ParticleEffect()
public ParticleEffect(ParticleEffect effect)
public void start()
public void reset()
reset(boolean)
.public void reset(boolean resetScaling)
resetScaling
- Whether to restore the original size and motion parameters if they were scaled. Repeated scaling and
resetting may introduce error.public void update(float delta)
public void draw(Batch spriteBatch)
public void draw(Batch spriteBatch, float delta)
public void allowCompletion()
public boolean isComplete()
public void setDuration(int duration)
public void setPosition(float x, float y)
public void setFlip(boolean flipX, boolean flipY)
public void flipY()
public Array<ParticleEmitter> getEmitters()
public ParticleEmitter findEmitter(String name)
public void preAllocateParticles()
ParticleEmitter.preAllocateParticles()
public void save(Writer output) throws IOException
IOException
public void load(FileHandle effectFile, FileHandle imagesDir)
public void load(FileHandle effectFile, TextureAtlas atlas)
public void load(FileHandle effectFile, TextureAtlas atlas, String atlasPrefix)
public void loadEmitters(FileHandle effectFile)
public void loadEmitterImages(TextureAtlas atlas)
public void loadEmitterImages(TextureAtlas atlas, String atlasPrefix)
public void loadEmitterImages(FileHandle imagesDir)
public void dispose()
dispose
in interface Disposable
public BoundingBox getBoundingBox()
public void scaleEffect(float scaleFactor)
ParticleEffectPool
, the scale will be reset when it is returned to the pool.public void scaleEffect(float scaleFactor, float motionScaleFactor)
ParticleEffectPool
, the scale will be reset when it is returned to the pool.public void scaleEffect(float xSizeScaleFactor, float ySizeScaleFactor, float motionScaleFactor)
ParticleEffectPool
, the scale will be reset when it is returned to the pool.public void setEmittersCleanUpBlendFunction(boolean cleanUpBlendFunction)
cleansUpBlendFunction
parameter on all ParticleEmitters
currently in this ParticleEffect.
IMPORTANT: If set to false and if the next object to use this Batch expects alpha blending, you are responsible for setting the Batch's blend function to (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) before that next object is drawn.
cleanUpBlendFunction
- Copyright © 2020. All rights reserved.