use of com.badlogic.gdx.graphics.g3d.particles.ParticleEffect in project libgdx by libgdx.
the class EffectPanel method importEffect.
protected void importEffect() {
File file = editor.showFileLoadDialog();
if (file != null) {
ParticleEffect effect;
if ((effect = editor.openEffect(file, false)) != null) {
for (ParticleController controller : effect.getControllers()) addEmitter(controller, false);
editIndex = 0;
emitterTable.getSelectionModel().setSelectionInterval(editIndex, editIndex);
}
}
}
use of com.badlogic.gdx.graphics.g3d.particles.ParticleEffect in project libgdx by libgdx.
the class ParticleControllerInfluencerPanel method handle.
@Override
public void handle(int aEventType, Object aEventData) {
if (aEventType == FlameMain.EVT_ASSET_RELOADED) {
Object[] data = (Object[]) aEventData;
if (data[0] instanceof ParticleEffect) {
ParticleEffect oldEffect = (ParticleEffect) data[0];
int currentCount = value.templates.size;
value.templates.removeAll(oldEffect.getControllers(), true);
if (value.templates.size != currentCount) {
int diff = currentCount - value.templates.size;
if (diff > 0) {
ParticleEffect newEffect = (ParticleEffect) data[1];
Array<ParticleController> newControllers = newEffect.getControllers();
if (newControllers.size > 0) {
for (int i = 0, c = Math.min(diff, newControllers.size); i < c; ++i) value.templates.add(newControllers.get(i));
}
} else {
value.templates.addAll(((ParticleEffect) editor.assetManager.get(FlameMain.DEFAULT_BILLBOARD_PARTICLE)).getControllers());
}
controllerPicker.reloadTemplates();
controllerPicker.setValue(value.templates);
editor.restart();
}
}
}
}
Aggregations