use of com.badlogic.gdx.graphics.g2d.ParticleEmitter in project Eidolons by IDemiurge.
the class Anim method getTimeToFinish.
private float getTimeToFinish() {
float time = 0;
for (EmitterActor e : emitterList) {
for (ParticleEmitter emitter : e.getEffect().getEmitters()) {
float timeLeft = emitter.getDuration().getLowMax() / 1000 * Math.max(0, emitter.getPercentComplete());
if (timeLeft > time) {
time = timeLeft;
}
}
}
float gracePeriod = 0.25f;
time = time + time * gracePeriod;
LogMaster.log(LogMaster.ANIM_DEBUG, this + " adding TimeToFinish: " + time);
return time;
}
use of com.badlogic.gdx.graphics.g2d.ParticleEmitter in project Eidolons by IDemiurge.
the class ParticleEffect method offset.
public void offset(float offset, EMITTER_VALS_SCALED value) {
for (ParticleEmitter e : getEmitters()) {
Emitter emitter = (Emitter) e;
emitter.offset(offset, value.name().toLowerCase());
}
}
use of com.badlogic.gdx.graphics.g2d.ParticleEmitter in project Eidolons by IDemiurge.
the class ParticleEffect method set.
public void set(String valName, String value) {
for (ParticleEmitter e : getEmitters()) {
Emitter emitter = (Emitter) e;
emitter.set(valName, value.toLowerCase());
}
}
use of com.badlogic.gdx.graphics.g2d.ParticleEmitter in project Eidolons by IDemiurge.
the class ParticleEffect method loadEmitters.
public void loadEmitters(FileHandle effectFile) {
InputStream input = effectFile.read();
getEmitters().clear();
BufferedReader reader = null;
try {
reader = new BufferedReader(new InputStreamReader(input), 512);
while (true) {
ParticleEmitter emitter = (checkSprite(effectFile)) ? new SpriteEmitter(reader) : new Emitter(reader);
getEmitters().add(emitter);
if (reader.readLine() == null) {
break;
}
if (reader.readLine() == null) {
break;
}
}
} catch (IOException ex) {
throw new GdxRuntimeException("Error loading effect: " + effectFile, ex);
} finally {
StreamUtils.closeQuietly(reader);
}
}
Aggregations