/** * Widens the emission angle of the supplied emitters * by the supplied coefficient. * * @param pe * @param coef */ public static void widen(Array<ParticleEmitter> emitters, float coef) { for (ParticleEmitter e : emitters) { float highMin = e.getAngle().getHighMin(); float highMax = e.getAngle().getHighMax(); float oldDist = (highMax - highMin); float newDist = oldDist * coef; float distDif = newDist - oldDist; e.getAngle().setHighMax(highMax + distDif / 2); e.getAngle().setHighMin(highMin - distDif / 2); float lowMin = e.getAngle().getLowMin(); float lowMax = e.getAngle().getLowMax(); oldDist = (lowMax - lowMin); newDist = oldDist * coef; distDif = newDist - oldDist; e.getAngle().setLowMax(lowMax + distDif / 2); e.getAngle().setLowMin(lowMin - distDif / 2); } }
@Override public void update(float deltaTime) { if (attachedObj != null) { setPosition(attachedObj.getX() + objOffsetX, attachedObj.getY() + objOffsetY); } if (loopPosition > 0) { for (ParticleEmitter emitter : getEmitters()) { if (emitter.durationTimer > loopPosition) { emitter.durationTimer = loopPosition; } } } super.update(deltaTime); }
public void addEffect(String name, Vector2 position, float angle){ logger.debug("Creating effect: " + name); ParticleEffect effect = App.assets.getEffect(name); if (effect == null) { logger.error("Couldn't create particle effect: " + name); return; } ParticleEffect e = new ParticleEffect(effect); for (ParticleEmitter emitter : e.getEmitters()){ float a1 = emitter.getAngle().getHighMin(), a2 = emitter.getAngle().getHighMax(); emitter.getRotation().setHighMin(a1 + angle); emitter.getRotation().setHighMax(a2 + angle); } e.setPosition(position.x * App.engine.PIXELS_PER_METER, position.y * App.engine.PIXELS_PER_METER); e.start(); effects.add(e); }
public ImageIcon getIcon (ParticleEmitter emitter) { ParticleData data = particleData.get(emitter); if (data == null) particleData.put(emitter, data = new ParticleData()); String imagePath = emitter.getImagePath(); if (data.icon == null && imagePath != null) { try { URL url; File file = new File(imagePath); if (file.exists()) url = file.toURI().toURL(); else { url = ParticleEditor.class.getResource(imagePath); if (url == null) return null; } data.icon = new ImageIcon(url); } catch (MalformedURLException ex) { ex.printStackTrace(); } } return data.icon; }
private void loadImage (ParticleEmitter emitter) { final String imagePath = emitter.getImagePath(); String imageName = new File(imagePath.replace('\\', '/')).getName(); try { FileHandle file; if (imagePath.equals(ParticleEditor.DEFAULT_PARTICLE) || imagePath.equals(ParticleEditor.DEFAULT_PREMULT_PARTICLE)) file = Gdx.files.classpath(imagePath); else file = Gdx.files.absolute(imagePath); emitter.setSprite(new Sprite(new Texture(file))); } catch (GdxRuntimeException ex) { ex.printStackTrace(); EventQueue.invokeLater(new Runnable() { public void run () { JOptionPane.showMessageDialog(ParticleEditor.this, "Error loading image:\n" + imagePath); } }); emitter.setImagePath(null); } }
public ParticleEmitter newEmitter (String name, boolean select) { final ParticleEmitter emitter = new ParticleEmitter(); emitter.getDuration().setLow(1000); emitter.getEmission().setHigh(50); emitter.getLife().setHigh(500); emitter.getScale().setHigh(32, 32); emitter.getTint().setColors(new float[] {1, 0.12156863f, 0.047058824f}); emitter.getTransparency().setHigh(1); emitter.setMaxParticleCount(25); emitter.setImagePath(ParticleEditor.DEFAULT_PARTICLE); addEmitter(name, select, emitter); return emitter; }
private void addEmitter (String name, boolean select, final ParticleEmitter emitter) { Array<ParticleEmitter> emitters = editor.effect.getEmitters(); if (emitters.size == 0) emitter.setPosition(editor.worldCamera.viewportWidth / 2, editor.worldCamera.viewportHeight / 2); else { ParticleEmitter p = emitters.get(0); emitter.setPosition(p.getX(), p.getY()); } emitters.add(emitter); emitterTableModel.addRow(new Object[] {name, true}); if (select) { editor.reloadRows(); int row = emitterTableModel.getRowCount() - 1; emitterTable.getSelectionModel().setSelectionInterval(row, row); } }
void saveEffect () { FileDialog dialog = new FileDialog(editor, "Save Effect", FileDialog.SAVE); if (lastDir != null) dialog.setDirectory(lastDir); dialog.setVisible(true); String file = dialog.getFile(); String dir = dialog.getDirectory(); if (dir == null || file == null || file.trim().length() == 0) return; lastDir = dir; int index = 0; for (ParticleEmitter emitter : editor.effect.getEmitters()) emitter.setName((String)emitterTableModel.getValueAt(index++, 0)); File outputFile = new File(dir, file); Writer fileWriter = null; try { fileWriter = new FileWriter(outputFile); editor.effect.save(fileWriter); } catch (Exception ex) { System.out.println("Error saving effect: " + outputFile.getAbsolutePath()); ex.printStackTrace(); JOptionPane.showMessageDialog(editor, "Error saving effect."); } finally { StreamUtils.closeQuietly(fileWriter); } }
public void resetEffect() { stopped = false; playbackTime = 0f; playbackDuration = 1f + Random.randomInt(1.75f, 4.5f); activeEffect.setPosition(Random.randomInt(worldBounds.x, worldBounds.width + 1), Random.randomInt(worldBounds.y, worldBounds.height + 1)); for (ParticleEmitter emitter : activeEffect.getEmitters()) { emitter.reset(); if (!emitter.getName().contains("smoke")) { emitter.getTint().setColors(colorsIterator.next()); } } }
public ImageIcon getIcon (ParticleEmitter emitter) { ParticleData data = particleData.get(emitter); if (data == null) particleData.put(emitter, data = new ParticleData()); String imagePath = emitter.getImagePath(); if (data.icon == null && imagePath != null) { try { URL url; File file = new File(imagePath); if (file.exists()) url = file.toURI().toURL(); else { url = ParticlePanel.class.getResource(imagePath); if (url == null) return null; } data.icon = new ImageIcon(url); } catch (MalformedURLException ex) { ex.printStackTrace(); } } return data.icon; }
public ParticleEmitter newEmitter (String name, boolean select) { final ParticleEmitter emitter = new ParticleEmitter(); emitter.getDuration().setLow(1000); emitter.getEmission().setHigh(50); emitter.getLife().setHigh(500); emitter.getScale().setHigh(32, 32); emitter.getTint().setColors(new float[] {1, 0.12156863f, 0.047058824f}); emitter.getTransparency().setHigh(1); emitter.setFlip(false, true); emitter.setMaxParticleCount(25); emitter.setImagePath("particle.png"); addEmitter(name, select, emitter); return emitter; }
void saveEffect () { FileDialog dialog = new FileDialog((Frame) null, "Save Effect", FileDialog.SAVE); if (lastDir != null) dialog.setDirectory(lastDir); dialog.setVisible(true); String file = dialog.getFile(); String dir = dialog.getDirectory(); if (dir == null || file == null || file.trim().length() == 0) return; lastDir = dir; int index = 0; for (ParticleEmitter emitter : editor.effect.getEmitters()) emitter.setName((String)emitterTableModel.getValueAt(index++, 0)); try { editor.effect.save(new File(dir, file)); } catch (Exception ex) { System.out.println("Error saving effect: " + new File(dir, file).getAbsolutePath()); ex.printStackTrace(); JOptionPane.showMessageDialog(editor, "Error saving effect."); } }
private void loadImage (ParticleEmitter emitter) { final String imagePath = emitter.getImagePath(); String imageName = new File(imagePath.replace('\\', '/')).getName(); try { FileHandle file; if (imagePath.equals("particle.png")) file = Gdx.files.classpath(imagePath); else file = Gdx.files.absolute(imagePath); emitter.setSprite(new Sprite(new Texture(file))); } catch (GdxRuntimeException ex) { ex.printStackTrace(); EventQueue.invokeLater(new Runnable() { public void run () { JOptionPane.showMessageDialog(ParticleRenderer.this.particlePanel, "Error loading image:\n" + imagePath); } }); emitter.setImagePath(null); } }
/** * Adds a ParticleEffect from a ParticleEffectVO. Uses ParticleEmitterBox2D * @param item ParticleEffectVO to add */ private static void addParticle(ParticleEffectVO item) { ParticleEffect particleEffect = new ParticleEffect(); particleEffect.load(Gdx.files.internal(particlesPath + "/" + item.particleName), atlas); particleEffect.scaleEffect(ZeroBit.pixelsToMeters * item.scaleX); for (int i=0; i < particleEffect.getEmitters().size; i++) { particleEffect.getEmitters().set(i, new ParticleEmitterBox2D(b2dSystem.getB2World(), particleEffect.getEmitters().get(i))); ParticleEmitter emitter = particleEffect.getEmitters().get(i); // Spawn scaling doesn't seem to alter the actual dimensions of the effect like in the editor /*emitter.getSpawnWidth().setHigh(emitter.getSpawnWidth().getHighMin() * item.scaleX, emitter.getSpawnWidth().getHighMax() * item.scaleX); emitter.getSpawnWidth().setLow(emitter.getSpawnWidth().getLowMin() * item.scaleX, emitter.getSpawnWidth().getLowMax() * item.scaleX); emitter.getSpawnHeight().setHigh(emitter.getSpawnHeight().getHighMin() * item.scaleY, emitter.getSpawnHeight().getHighMax() * item.scaleY); emitter.getSpawnHeight().setLow(emitter.getSpawnHeight().getLowMin() * item.scaleY, emitter.getSpawnHeight().getLowMax() * item.scaleY);*/ emitter.setPosition(item.x * ZeroBit.pixelsToMeters, item.y * ZeroBit.pixelsToMeters); } //entityManager.getEngine().getSystem(RenderingSystem.class).addParticle(particleEffect); ParticleComponent pc = new ParticleComponent(); pc.addParticle(particleEffect); addEntity(item, null, pc, new VisualComponent()); }
@Override public void setAlpha(float alpha) { // TODO: Alpha doesn't work for particles here as intended :( this.alpha = alpha; for (ParticleEffect e : effects.keySet()) { for (ParticleEmitter emitter : e.getEmitters()) { ScaledNumericValue v = emitter.getTransparency(); v.setHigh(alpha); v.setLow(alpha); } } }
@Override public void onCreateColor(Monster monster, MonsterColor color) { ParticleEffect effect = manager.create(Assets.getInstance().get(Assets.FLARE, ParticleEffect.class), false); Maze maze = monster.getMaze(); float x = color.getX() * maze.getBlockSize() + maze.getX() + maze.getBlockSize() / 2; float y = color.getY() * maze.getBlockSize() + maze.getY() + maze.getBlockSize() / 2; effect.setPosition(x, y); manager.setColor(effect, new float[]{color.r, color.g, color.b}, new float[]{0f}); effect.start(); for (ParticleEmitter e : effect.getEmitters()) { e.getScale().setLow(Gdx.graphics.getWidth() / 100f); e.getDuration().setLow(Monster.LENGTH * StupidMonsterLogic.INTERVAL); e.getLife().setLow(Monster.LENGTH * StupidMonsterLogic.INTERVAL); e.getDuration().setLowMin(Monster.LENGTH * StupidMonsterLogic.INTERVAL); e.getLife().setLowMin(Monster.LENGTH * StupidMonsterLogic.INTERVAL); e.getVelocity().setLow(Gdx.graphics.getWidth() / 300f); } effects.put(color, effect); }
@Override public void onRemoveTrailColor(MonsterColor color) { Maze maze = color.getMonster().getMaze(); ParticleEffect effect = manager.create(Assets.getInstance().get(Assets.FLARE, ParticleEffect.class), false); float x = color.getX() * maze.getBlockSize() + maze.getX() + maze.getBlockSize() / 2; float y = color.getY() * maze.getBlockSize() + maze.getY() + maze.getBlockSize() / 2; effect.setPosition(x, y); manager.setColor(effect, new float[]{color.r, color.g, color.b}, new float[]{0f}); effect.start(); for (ParticleEmitter e : effect.getEmitters()) { e.getScale().setLow(Gdx.graphics.getWidth() / 30f); e.getDuration().setLow(Monster.LENGTH * StupidMonsterLogic.INTERVAL / 104); e.getLife().setLow(Monster.LENGTH * StupidMonsterLogic.INTERVAL / 140); e.getDuration().setLowMin(Monster.LENGTH * StupidMonsterLogic.INTERVAL / 140); e.getLife().setLowMin(Monster.LENGTH * StupidMonsterLogic.INTERVAL / 140); e.getVelocity().setLow(Gdx.graphics.getWidth() / 50f); } effects.put(color, effect); Gdx.input.vibrate(20); }
private void loadImage (ParticleEmitter emitter) { final String imagePath = emitter.getImagePath(); String imageName = new File(imagePath.replace('\\', '/')).getName(); try { FileHandle file; if (imagePath.equals("particle.png")) file = Gdx.files.classpath(imagePath); else file = Gdx.files.absolute(imagePath); emitter.setSprite(new Sprite(new Texture(file))); } catch (GdxRuntimeException ex) { ex.printStackTrace(); EventQueue.invokeLater(new Runnable() { public void run () { JOptionPane.showMessageDialog(ParticleEditor.this, "Error loading image:\n" + imagePath); } }); emitter.setImagePath(null); } }
void saveEffect () { FileDialog dialog = new FileDialog(editor, "Save Effect", FileDialog.SAVE); if (lastDir != null) dialog.setDirectory(lastDir); dialog.setVisible(true); String file = dialog.getFile(); String dir = dialog.getDirectory(); if (dir == null || file == null || file.trim().length() == 0) return; lastDir = dir; int index = 0; for (ParticleEmitter emitter : editor.effect.getEmitters()) emitter.setName((String)emitterTableModel.getValueAt(index++, 0)); try { editor.effect.save(new File(dir, file)); } catch (Exception ex) { System.out.println("Error saving effect: " + new File(dir, file).getAbsolutePath()); ex.printStackTrace(); JOptionPane.showMessageDialog(editor, "Error saving effect."); } }
@Override public void onCollide(int indexX, int indexY, Snake snake, WorldEntity target) { ParticleEffect explodeEffect = target.getType().getExplodeEffect(); if (explodeEffect != null) { ParticleEffect effect = particleManager.create(explodeEffect, false); alignOnIndex(indexX, indexY, effect); for (ParticleEmitter emitter : effect.getEmitters()) { emitter.setMaxParticleCount(emitter.getMaxParticleCount() / target.getType().getParticleDecreaseFactor()); } effect.start(); } }
private static boolean containsAdditive(PooledEffect effect) { boolean additive = false; Array<ParticleEmitter> emmiters = effect.getEmitters(); for (int i = 0; i < emmiters.size; i++) { if (emmiters.get(i).isAdditive()) { additive = true; break; } } return additive; }
/** * Resets the position, start color and duration of the given firework effects to random values. * * @param effect */ private void resetFireworksEffect(ParticleEffect effect) { effect.reset(); effect.setDuration(Utils.randomWithin(180, 250)); effect.setPosition(Utils.randomWithin(0, WINDOW_WIDTH), Utils.randomWithin(0, WINDOW_HEIGHT)); float[] colors = effect.getEmitters().get(0).getTint().getColors(); int randomStartColor = Utils.randomWithin(0, startColors.length - 1); for (int i = 0; i < 6; i++) { colors[i] = startColors[randomStartColor][i % 3]; } for (ParticleEmitter emitter : effect.getEmitters()) { emitter.getTint().setColors(colors); } }
/** * Returns all emitters from the supplied effect with a name * that starts with the supplied prefix. * * Case insensitive. * * @param pe * @param prefix * @return */ public static Array<ParticleEmitter> getEmittersByName(ParticleEffect pe, String prefix) { prefix = prefix.toLowerCase(Locale.ENGLISH); Array<ParticleEmitter> returnValue = new Array<ParticleEmitter>(); for (ParticleEmitter p : pe.getEmitters()) { if (p.getName().toLowerCase(Locale.ENGLISH).startsWith(prefix)) { returnValue.add(p); } } return returnValue; }
/** * Rotates the supplied emitters by the supplied * angle by adding it to the emission * angleemitters. * * @param pe * @param angle the angle to rotate by, in degrees */ public static void rotateBy(Array<ParticleEmitter> emitters, float angle) { for (ParticleEmitter e : emitters) { float firstHighMin = e.getAngle().getHighMin(); float firstHighMax = e.getAngle().getHighMax(); float firstLowMax = e.getAngle().getLowMax(); float firstLowMin = e.getAngle().getLowMin(); e.getAngle().setHighMax(angle + firstHighMax); e.getAngle().setHighMin(angle + firstHighMin); e.getAngle().setLowMax(angle + firstLowMax); e.getAngle().setLowMin(angle + firstLowMin); } }
/** * Rotates the supplied particle effect by setting * the angle value of all emitters to the supplied value. * * The first emitter is rotated to the supplied value * and the others are then rotated relatively to the first one. * * @param pe * @param angle the new angle, in degrees */ public static void rotate(ParticleEffect pe, float angle) { boolean first = true; float firstHighMax = 0, firstHighMin = 0, firstLowMax = 0, firstLowMin = 0; for (ParticleEmitter e : pe.getEmitters()) { if (first) { firstHighMin = e.getAngle().getHighMin(); firstHighMax = e.getAngle().getHighMax(); firstLowMax = e.getAngle().getLowMax(); firstLowMin = e.getAngle().getLowMin(); e.getAngle().setHighMax(angle); e.getAngle().setHighMin(angle - (firstHighMax-firstHighMin)); e.getAngle().setLowMax(angle - (firstHighMax-firstLowMax)); e.getAngle().setLowMin(angle - (firstHighMax-firstLowMin)); first = false; } else { float oldAngle = e.getAngle().getHighMax(); e.getAngle().setHighMax(angle - (firstHighMax-oldAngle)); oldAngle = e.getAngle().getHighMin(); e.getAngle().setHighMin(angle - (firstHighMin-oldAngle)); oldAngle = e.getAngle().getLowMax(); e.getAngle().setLowMax(angle - (firstLowMax-oldAngle)); oldAngle = e.getAngle().getLowMin(); e.getAngle().setLowMin(angle - (firstLowMin-oldAngle)); } } }
/** * Changes the particle velocity of the supplied emitters * by multiplying it by the supplied coefficient. * * @param pe * @param coef */ public static void slow(Array<ParticleEmitter> emitters, float coef) { for (ParticleEmitter e : emitters) { float velocityHighMin = e.getVelocity().getHighMin(); float velocityHighMax = e.getVelocity().getHighMax(); float velocityLowMin = e.getVelocity().getLowMin(); float velocityLowMax = e.getVelocity().getLowMax(); e.getVelocity().setHighMax(velocityHighMax * coef); e.getVelocity().setHighMin(velocityHighMin * coef); e.getVelocity().setLowMax(velocityLowMax * coef); e.getVelocity().setLowMin(velocityLowMin * coef); } }
public Engine(boolean fallIn, float toX) { super(fallIn, toX); sprite = new Sprite(Game.gfxMgr.getTexture("test", "engine.png")); sprite.setOrigin(sprite.getWidth() / 2f, sprite.getHeight() / 2); emit = new ParticleEmitter(Game.gfxMgr.getParticleEffect("test", "boss.p").getEmitters().get(0)); emit.setPosition(this.x, this.y); laser = null; chargingMyLaser = false; this.bound = new Circle(this.x, this.y, 8); }
public void stop() { for (ParticleEmitter emitter : getEmitters()) { if (emitter.duration > loopPosition) { loopPosition = emitter.duration; } } }
public ParticleEmitter newExampleEmitter (String name, boolean select) { final ParticleEmitter emitter = new ParticleEmitter(); emitter.getDuration().setLow(3000); emitter.getEmission().setHigh(250); emitter.getLife().setHigh(500, 1000); emitter.getLife().setTimeline(new float[] {0, 0.66f, 1}); emitter.getLife().setScaling(new float[] {1, 1, 0.3f}); emitter.getScale().setHigh(32, 32); emitter.getRotation().setLow(1, 360); emitter.getRotation().setHigh(180, 180); emitter.getRotation().setTimeline(new float[] {0, 1}); emitter.getRotation().setScaling(new float[] {0, 1}); emitter.getRotation().setRelative(true); emitter.getAngle().setHigh(45, 135); emitter.getAngle().setLow(90); emitter.getAngle().setTimeline(new float[] {0, 0.5f, 1}); emitter.getAngle().setScaling(new float[] {1, 0, 0}); emitter.getAngle().setActive(true); emitter.getVelocity().setHigh(30, 300); emitter.getVelocity().setActive(true); emitter.getTint().setColors(new float[] {1, 0.12156863f, 0.047058824f}); emitter.getTransparency().setHigh(1, 1); emitter.getTransparency().setTimeline(new float[] {0, 0.2f, 0.8f, 1}); emitter.getTransparency().setScaling(new float[] {0, 1, 0.75f, 0}); emitter.setMaxParticleCount(200); emitter.setImagePath(ParticleEditor.DEFAULT_PARTICLE); addEmitter(name, select, emitter); return emitter; }
void openEffect () { FileDialog dialog = new FileDialog(editor, "Open Effect", FileDialog.LOAD); if (lastDir != null) dialog.setDirectory(lastDir); dialog.setVisible(true); final String file = dialog.getFile(); final String dir = dialog.getDirectory(); if (dir == null || file == null || file.trim().length() == 0) return; lastDir = dir; ParticleEffect effect = new ParticleEffect(); try { effect.loadEmitters(Gdx.files.absolute(new File(dir, file).getAbsolutePath())); editor.effect = effect; emitterTableModel.getDataVector().removeAllElements(); editor.particleData.clear(); } catch (Exception ex) { System.out.println("Error loading effect: " + new File(dir, file).getAbsolutePath()); ex.printStackTrace(); JOptionPane.showMessageDialog(editor, "Error opening effect."); return; } for (ParticleEmitter emitter : effect.getEmitters()) { emitter.setPosition(editor.worldCamera.viewportWidth / 2, editor.worldCamera.viewportHeight / 2); emitterTableModel.addRow(new Object[] {emitter.getName(), true}); } editIndex = 0; emitterTable.getSelectionModel().setSelectionInterval(editIndex, editIndex); editor.reloadRows(); }
void duplicateEmitter() { int row = emitterTable.getSelectedRow(); if (row == -1) return; String name = (String)emitterTableModel.getValueAt(row, 0); addEmitter(name, true, new ParticleEmitter(editor.effect.getEmitters().get(row))); }
void move (int direction) { if (direction < 0 && editIndex == 0) return; Array<ParticleEmitter> emitters = editor.effect.getEmitters(); if (direction > 0 && editIndex == emitters.size - 1) return; int insertIndex = editIndex + direction; Object name = emitterTableModel.getValueAt(editIndex, 0); emitterTableModel.removeRow(editIndex); ParticleEmitter emitter = emitters.removeIndex(editIndex); emitterTableModel.insertRow(insertIndex, new Object[] {name}); emitters.insert(insertIndex, emitter); editIndex = insertIndex; emitterTable.getSelectionModel().setSelectionInterval(editIndex, editIndex); }
@Override public void setSize(float width, float height) { for (ParticleEmitter emitter : particleEffect.getEmitters()) { emitter.getSpawnWidth().setHigh(width); emitter.getSpawnHeight().setHigh(height); } }
void openEffect () { FileDialog dialog = new FileDialog((Frame) null, "Open Effect", FileDialog.LOAD); if (lastDir != null) dialog.setDirectory(lastDir); dialog.setVisible(true); final String file = dialog.getFile(); final String dir = dialog.getDirectory(); if (dir == null || file == null || file.trim().length() == 0) return; lastDir = dir; ParticleEffect effect = new ParticleEffect(); try { effect.loadEmitters(Gdx.files.absolute(new File(dir, file).getAbsolutePath())); editor.effect = effect; emitterTableModel.getDataVector().removeAllElements(); editor.particleData.clear(); } catch (Exception ex) { System.out.println("Error loading effect: " + new File(dir, file).getAbsolutePath()); ex.printStackTrace(); JOptionPane.showMessageDialog(editor, "Error opening effect."); return; } for (ParticleEmitter emitter : effect.getEmitters()) { emitter.setPosition(editor.worldCamera.viewportWidth / 2, editor.worldCamera.viewportHeight / 2); emitterTableModel.addRow(new Object[] {emitter.getName(), true}); } editIndex = 0; emitterTable.getSelectionModel().setSelectionInterval(editIndex, editIndex); editor.reloadRows(); }
public int getParticleCount(ParticleEffect effect) { int count = 0; for (ParticleEmitter emitter : effect.getEmitters()) { if (count < emitter.getMaxParticleCount()) { count = emitter.getMaxParticleCount(); } } return count; }
public void setEndless(ParticleEffect effect, boolean endless) { if (effect != null) { effects.put(effect, endless); for (ParticleEmitter emitter : effect.getEmitters()) { emitter.setContinuous(endless); } } }