Package com.badlogic.gdx
Class ParticleEmitter
java.lang.Object
com.badlogic.gdx.ParticleEmitter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic enumstatic enumstatic classstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionfloatfloat -
Constructor Summary
ConstructorsConstructorDescriptionParticleEmitter(ParticleEmitter emitter) ParticleEmitter(BufferedReader reader) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddParticles(int count) voidIgnores thecontinuoussetting until the emitter is started again.booleanvoiddraw(com.badlogic.gdx.graphics.g2d.Batch batch) voiddraw(com.badlogic.gdx.graphics.g2d.Batch batch, float delta) Updates and draws the particles.voidflipY()boolean[]intbooleangetAngle()com.badlogic.gdx.math.collision.BoundingBoxReturns the bounding box for all active particles. z axis will always be zero.intgetDelay()com.badlogic.gdx.utils.Array<String> getLife()intintprotected ParticleEmitter.RangedNumericValue[]getName()floatcom.badlogic.gdx.utils.Array<com.badlogic.gdx.graphics.g2d.Sprite> getTint()getWind()floatgetX()protected ParticleEmitter.RangedNumericValue[]floatgetY()protected ParticleEmitter.RangedNumericValue[]booleanbooleanbooleanbooleanisBehind()booleanbooleanbooleanvoidload(BufferedReader reader) voidmatchMotion(ParticleEmitter template) Sets all motion-related ranged values to match those of the template emitter.voidmatchSize(ParticleEmitter template) Sets all size-related ranged values to match those of the template emitter.voidmatchXSize(ParticleEmitter template) Sets all horizontal size-related ranged values to match those of the template emitter.voidmatchYSize(ParticleEmitter template) Sets all vertical size-related ranged values to match those of the template emitter.protected ParticleEmitter.ParticlenewParticle(com.badlogic.gdx.graphics.g2d.Sprite sprite) voidAllocates max particles emitter can hold.voidreset()voidreset(boolean start) voidvoidscaleMotion(float scale) Permanently scales the speed of the emitter by scaling all its ranged values related to motion.voidscaleSize(float scale) Permanently scales the size of the emitter by scaling all its ranged values related to size.voidscaleSize(float scaleX, float scaleY) Permanently scales the size of the emitter by scaling all its ranged values related to size.voidsetAdditive(boolean additive) voidsetAligned(boolean aligned) voidsetAttached(boolean attached) voidsetBehind(boolean behind) voidsetCleansUpBlendFunction(boolean cleansUpBlendFunction) voidsetContinuous(boolean continuous) voidsetFlip(boolean flipX, boolean flipY) voidsetImagePaths(com.badlogic.gdx.utils.Array<String> imagePaths) voidsetMaxParticleCount(int maxParticleCount) voidsetMinParticleCount(int minParticleCount) voidvoidsetPosition(float x, float y) voidsetPremultipliedAlpha(boolean premultipliedAlpha) voidsetSpriteMode(ParticleEmitter.SpriteMode spriteMode) voidsetSprites(com.badlogic.gdx.utils.Array<com.badlogic.gdx.graphics.g2d.Sprite> sprites) voidstart()voidupdate(float delta)
-
Field Details
-
particles
-
duration
public float duration -
durationTimer
public float durationTimer
-
-
Constructor Details
-
ParticleEmitter
public ParticleEmitter() -
ParticleEmitter
- Throws:
IOException
-
ParticleEmitter
-
-
Method Details
-
getActiveArray
public boolean[] getActiveArray() -
getCapacity
public int getCapacity() -
setMaxParticleCount
public void setMaxParticleCount(int maxParticleCount) -
addParticle
public void addParticle() -
addParticles
public void addParticles(int count) -
update
public void update(float delta) -
draw
public void draw(com.badlogic.gdx.graphics.g2d.Batch batch) -
draw
public void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float delta) Updates and draws the particles. This is slightly more efficient than callingupdate(float)anddraw(Batch)separately. -
start
public void start() -
reset
public void reset() -
reset
public void reset(boolean start) -
newParticle
-
getParticles
-
setPosition
public void setPosition(float x, float y) -
setSprites
public void setSprites(com.badlogic.gdx.utils.Array<com.badlogic.gdx.graphics.g2d.Sprite> sprites) -
setSpriteMode
-
preAllocateParticles
public void preAllocateParticles()Allocates max particles emitter can hold. Usually called early on to avoid allocation on updates.setSprites(Array)must have been set before calling this method -
allowCompletion
public void allowCompletion()Ignores thecontinuoussetting until the emitter is started again. This allows the emitter to stop smoothly. -
getAllowCompletion
public boolean getAllowCompletion() -
getSprites
public com.badlogic.gdx.utils.Array<com.badlogic.gdx.graphics.g2d.Sprite> getSprites() -
getSpriteMode
-
getName
-
setName
-
getLife
-
getXScale
-
getYScale
-
getRotation
-
getTint
-
getVelocity
-
getWind
-
getGravity
-
getAngle
-
getEmission
-
getTransparency
-
getDuration
-
getDelay
-
getLifeOffset
-
getXOffsetValue
-
getYOffsetValue
-
getSpawnWidth
-
getSpawnHeight
-
getSpawnShape
-
isAttached
public boolean isAttached() -
setAttached
public void setAttached(boolean attached) -
isContinuous
public boolean isContinuous() -
setContinuous
public void setContinuous(boolean continuous) -
isAligned
public boolean isAligned() -
setAligned
public void setAligned(boolean aligned) -
isAdditive
public boolean isAdditive() -
setAdditive
public void setAdditive(boolean additive) -
cleansUpBlendFunction
public boolean cleansUpBlendFunction() -
setCleansUpBlendFunction
public void setCleansUpBlendFunction(boolean cleansUpBlendFunction) -
isBehind
public boolean isBehind() -
setBehind
public void setBehind(boolean behind) -
isPremultipliedAlpha
public boolean isPremultipliedAlpha() -
setPremultipliedAlpha
public void setPremultipliedAlpha(boolean premultipliedAlpha) -
getMinParticleCount
public int getMinParticleCount() -
setMinParticleCount
public void setMinParticleCount(int minParticleCount) -
getMaxParticleCount
public int getMaxParticleCount() -
isComplete
public boolean isComplete() -
getPercentComplete
public float getPercentComplete() -
getX
public float getX() -
getY
public float getY() -
getActiveCount
public int getActiveCount() -
getImagePaths
-
setImagePaths
-
setFlip
public void setFlip(boolean flipX, boolean flipY) -
flipY
public void flipY() -
getBoundingBox
public com.badlogic.gdx.math.collision.BoundingBox getBoundingBox()Returns the bounding box for all active particles. z axis will always be zero. -
getXSizeValues
-
getYSizeValues
-
getMotionValues
-
scaleSize
public void scaleSize(float scale) Permanently scales the size of the emitter by scaling all its ranged values related to size. -
scaleSize
public void scaleSize(float scaleX, float scaleY) Permanently scales the size of the emitter by scaling all its ranged values related to size. -
scaleMotion
public void scaleMotion(float scale) Permanently scales the speed of the emitter by scaling all its ranged values related to motion. -
matchSize
Sets all size-related ranged values to match those of the template emitter. -
matchXSize
Sets all horizontal size-related ranged values to match those of the template emitter. -
matchYSize
Sets all vertical size-related ranged values to match those of the template emitter. -
matchMotion
Sets all motion-related ranged values to match those of the template emitter. -
save
- Throws:
IOException
-
load
- Throws:
IOException
-