Example usage for com.badlogic.gdx.graphics.g2d ParticleEffect allowCompletion

List of usage examples for com.badlogic.gdx.graphics.g2d ParticleEffect allowCompletion

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.g2d ParticleEffect allowCompletion.

Prototype

public void allowCompletion() 

Source Link

Usage

From source file:org.lightjason.examples.pokemon.ui.CParticleSystem.java

License:LGPL

/**
 * creates the particle system//w w  w .j a  va  2 s  . c o  m
 *
 * @param p_unit scaling factor
 * @return self reference
 * @see http://stackoverflow.com/questions/25648386/android-libgdx-3d-particle-system-not-working-billboard
 * @see http://www.gamedev.net/page/share.php/_/creative/visual-arts/make-a-particle-explosion-effect-r2701
 * @see https://www.youtube.com/watch?v=HXYqg3G5kCo
 * @see http://codepoke.net/2011/12/27/opengl-libgdx-laser-fx/
 * @see http://stackoverflow.com/questions/14839648/libgdx-particleeffect-rotation
 * @see https://github.com/libgdx/libgdx/wiki/2D-ParticleEffects
 * @see https://github.com/libgdx/libgdx/wiki/3D-Particle-Effects
 * @see http://stackoverflow.com/questions/12261439/assetmanager-particleeffectloader-of-libgdx-android
 * @see https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests/src/com/badlogic/gdx/tests/ParticleEmitterTest.java
 */
public final CParticleSystem initialize(final String p_name, final float p_unit) {
    final String l_name = CParticleSystem.name(p_name);
    if (l_name.isEmpty())
        throw new RuntimeException("particle system name need not to be empty");
    if (m_effects.containsKey(l_name))
        return this;

    // create particle system
    final FileHandle l_file = Gdx.files.internal(MessageFormat.format(PARTICLEFILENAME, l_name));

    final ParticleEffect l_effect = new ParticleEffect();
    l_effect.load(l_file, l_file.parent());
    l_effect.scaleEffect(p_unit);
    l_effect.allowCompletion();

    m_effects.putIfAbsent(l_name, l_effect);
    return this;
}