com.badlogic.gdx.graphics.g3d.particles.ParticleSystem Java Examples

The following examples show how to use com.badlogic.gdx.graphics.g3d.particles.ParticleSystem. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GameScene.java    From GdxDemo3D with Apache License 2.0 6 votes vote down vote up
public void dispose() {
	ParticleSystem particleSystem = ParticleSystem.get();
	for (ParticleEffect pfx : particleEffects) {
		particleSystem.remove(pfx);
		pfx.dispose();
	}
	particleEffects.clear();
	navMesh.dispose();
	for (Array<GameObject> objs : gameObjects.values()) {
		for (GameObject obj : objs) {
			obj.dispose();
		}
	}
	gameObjects.clear();
	assets.dispose();
}
 
Example #2
Source File: Assets.java    From gdx-proto with Apache License 2.0 5 votes vote down vote up
public static void loadParticleEffects(ParticleSystem particleSystem) {
	ParticleEffectLoader.ParticleEffectLoadParameter loadParam = new ParticleEffectLoader.ParticleEffectLoadParameter(particleSystem.getBatches());
	ParticleEffectLoader loader = new ParticleEffectLoader(new InternalFileHandleResolver());
	manager.setLoader(ParticleEffect.class, loader);
	manager.load("particle/bullet-hit.pfx", ParticleEffect.class, loadParam);
	manager.load("particle/blue-explosion.pfx", ParticleEffect.class, loadParam);
	manager.finishLoading();
}
 
Example #3
Source File: Particles.java    From gdx-proto with Apache License 2.0 5 votes vote down vote up
public Particles() {
	inst = this;
	system = ParticleSystem.get();
	PointSpriteParticleBatch psBatch = new PointSpriteParticleBatch();
	psBatch.setCamera(View.inst.getCamera());
	system.add(psBatch);

	Assets.loadParticleEffects(system);

	ParticleEffect bulletHit = Assets.manager.get("particle/bullet-hit.pfx");
	ParticleEffect blueExplosion = Assets.manager.get("particle/blue-explosion.pfx");
	bulletHitPool = new PFXPool(bulletHit);
	blueExplosionPool = new PFXPool(blueExplosion);
}
 
Example #4
Source File: ParticleUtils.java    From Skyland with MIT License 4 votes vote down vote up
public ParticleUtils() {
    particleSystem = ParticleSystem.get();
}
 
Example #5
Source File: ParticleUtils.java    From Skyland with MIT License 4 votes vote down vote up
public ParticleSystem updateAndDraw() {
    update();
    return particleSystem;
}