Class ParticleEmitter

java.lang.Object
com.badlogic.gdx.ParticleEmitter

public class ParticleEmitter extends Object
  • Field Details

    • particles

      public ParticleEmitter.Particle[] particles
    • duration

      public float duration
    • durationTimer

      public float durationTimer
  • Constructor Details

  • 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 calling update(float) and draw(Batch) separately.
    • start

      public void start()
    • reset

      public void reset()
    • reset

      public void reset(boolean start)
    • newParticle

      protected ParticleEmitter.Particle newParticle(com.badlogic.gdx.graphics.g2d.Sprite sprite)
    • getParticles

      public ParticleEmitter.Particle[] 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

      public void setSpriteMode(ParticleEmitter.SpriteMode spriteMode)
    • 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 the continuous setting 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

      public ParticleEmitter.SpriteMode getSpriteMode()
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • getLife

    • getXScale

    • getYScale

    • getRotation

      public ParticleEmitter.ScaledNumericValue getRotation()
    • getTint

    • getVelocity

      public ParticleEmitter.ScaledNumericValue getVelocity()
    • getWind

    • getGravity

    • getAngle

    • getEmission

      public ParticleEmitter.ScaledNumericValue getEmission()
    • getTransparency

      public ParticleEmitter.ScaledNumericValue getTransparency()
    • getDuration

      public ParticleEmitter.RangedNumericValue getDuration()
    • getDelay

    • getLifeOffset

      public ParticleEmitter.ScaledNumericValue getLifeOffset()
    • getXOffsetValue

      public ParticleEmitter.RangedNumericValue getXOffsetValue()
    • getYOffsetValue

      public ParticleEmitter.RangedNumericValue getYOffsetValue()
    • getSpawnWidth

      public ParticleEmitter.ScaledNumericValue getSpawnWidth()
    • getSpawnHeight

      public ParticleEmitter.ScaledNumericValue getSpawnHeight()
    • getSpawnShape

      public ParticleEmitter.SpawnShapeValue 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

      public com.badlogic.gdx.utils.Array<String> getImagePaths()
    • setImagePaths

      public void setImagePaths(com.badlogic.gdx.utils.Array<String> imagePaths)
    • 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

      protected ParticleEmitter.RangedNumericValue[] getXSizeValues()
    • getYSizeValues

      protected ParticleEmitter.RangedNumericValue[] getYSizeValues()
    • getMotionValues

      protected ParticleEmitter.RangedNumericValue[] 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

      public void matchSize(ParticleEmitter template)
      Sets all size-related ranged values to match those of the template emitter.
    • matchXSize

      public void matchXSize(ParticleEmitter template)
      Sets all horizontal size-related ranged values to match those of the template emitter.
    • matchYSize

      public void matchYSize(ParticleEmitter template)
      Sets all vertical size-related ranged values to match those of the template emitter.
    • matchMotion

      public void matchMotion(ParticleEmitter template)
      Sets all motion-related ranged values to match those of the template emitter.
    • save

      public void save(Writer output) throws IOException
      Throws:
      IOException
    • load

      public void load(BufferedReader reader) throws IOException
      Throws:
      IOException