Class ParticleEffect

    • Field Detail

      • xSizeScale

        protected float xSizeScale
      • ySizeScale

        protected float ySizeScale
      • motionScale

        protected float motionScale
    • Constructor Detail

      • ParticleEffect

        public ParticleEffect()
    • Method Detail

      • start

        public void start()
      • reset

        public void reset()
        Resets the effect so it can be started again like a new effect. Any changes to scale are reverted. See reset(boolean).
      • reset

        public void reset​(boolean resetScaling)
        Resets the effect so it can be started again like a new effect.
        Parameters:
        resetScaling - Whether to restore the original size and motion parameters if they were scaled. Repeated scaling and resetting may introduce error.
      • update

        public void update​(float delta)
      • draw

        public void draw​(Batch spriteBatch)
      • draw

        public void draw​(Batch spriteBatch,
                         float delta)
      • allowCompletion

        public void allowCompletion()
      • isComplete

        public boolean isComplete()
      • setDuration

        public void setDuration​(int duration)
      • setPosition

        public void setPosition​(float x,
                                float y)
      • setFlip

        public void setFlip​(boolean flipX,
                            boolean flipY)
      • flipY

        public void flipY()
      • findEmitter

        public ParticleEmitter findEmitter​(java.lang.String name)
        Returns the emitter with the specified name, or null.
      • save

        public void save​(java.io.Writer output)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • loadEmitters

        public void loadEmitters​(FileHandle effectFile)
      • loadEmitterImages

        public void loadEmitterImages​(TextureAtlas atlas)
      • loadEmitterImages

        public void loadEmitterImages​(TextureAtlas atlas,
                                      java.lang.String atlasPrefix)
      • loadEmitterImages

        public void loadEmitterImages​(FileHandle imagesDir)
      • newEmitter

        protected ParticleEmitter newEmitter​(java.io.BufferedReader reader)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • dispose

        public void dispose()
        Disposes the texture for each sprite for each ParticleEmitter.
        Specified by:
        dispose in interface Disposable
      • getBoundingBox

        public BoundingBox getBoundingBox()
        Returns the bounding box for all active particles. z axis will always be zero.
      • scaleEffect

        public void scaleEffect​(float scaleFactor)
        Permanently scales all the size and motion parameters of all the emitters in this effect. If this effect originated from a ParticleEffectPool, the scale will be reset when it is returned to the pool.
      • scaleEffect

        public void scaleEffect​(float scaleFactor,
                                float motionScaleFactor)
        Permanently scales all the size and motion parameters of all the emitters in this effect. If this effect originated from a ParticleEffectPool, the scale will be reset when it is returned to the pool.
      • scaleEffect

        public void scaleEffect​(float xSizeScaleFactor,
                                float ySizeScaleFactor,
                                float motionScaleFactor)
        Permanently scales all the size and motion parameters of all the emitters in this effect. If this effect originated from a ParticleEffectPool, the scale will be reset when it is returned to the pool.
      • setEmittersCleanUpBlendFunction

        public void setEmittersCleanUpBlendFunction​(boolean cleanUpBlendFunction)
        Sets the 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.

        Parameters:
        cleanUpBlendFunction -