use of eidolons.libgdx.anims.particles.EmitterActor in project Eidolons by IDemiurge.
the class LightLayer method adjust.
private void adjust(LightContainer container) {
float scaleRange = container.lightLayer.scaleRange;
container.getContent().setScale(RandomWizard.getRandomFloatBetween(1 + scaleRange / 2, 1 + scaleRange));
container.setVisible(true);
addActor(container);
Boolean flipX = null;
float y, x = 0;
if (container.lightLayer.vertical) {
x = getWidth() / 3 + RandomWizard.getRandomInt((int) getWidth() / 3) - container.getWidth() / 2;
y = getHeight() - RandomWizard.getRandomFloatBetween(100, container.getContent().getScaleY() * container.getHeight() - 100);
flipX = RandomWizard.random();
} else {
flipX = time == DAY_TIME.DUSK;
if (time == DAY_TIME.MIDDAY) {
flipX = RandomWizard.random();
}
x = flipX ? -container.getWidth() / 3 - RandomWizard.getRandomInt((int) container.getWidth() / 3) : getWidth() - container.getWidth() / 2.25f - RandomWizard.getRandomInt((int) (container.getWidth() / 2));
y = RandomWizard.getRandomInt((int) getHeight());
}
container.setFlipX(flipX);
container.setPosition(x, y);
if (container.lightLayer.emitterPaths != null) {
for (String sub : container.lightLayer.emitterPaths) {
EmitterActor emitter = new EmitterActor(sub);
container.addActor(emitter);
emitter.setPosition(container.getWidth() / 2, GdxMaster.getHeight() - 25);
emitter.setSpeed(0.5f);
emitter.start();
emitter.getEffect().getEmitters().get(0).scaleSize(container.getScaleX() + 0.25f);
}
container.getContent().setZIndex(0);
}
}
use of eidolons.libgdx.anims.particles.EmitterActor in project Eidolons by IDemiurge.
the class MapParticles method create.
private EmitterActor create(String path, int x, int y, DAY_TIME time) {
// new EmitterActor(sfx.sfxPath);
EmitterActor actor = EmitterPools.getEmitterActor(path);
actor.setPosition(x, y);
actor.setSpeed(getSpeed(path));
actor.setFlipX(isFlipX(path, MacroGame.getGame().getWindDirection()));
actor.setFlipY(isFlipY(path, MacroGame.getGame().getWindDirection()));
MapMaster.addToListMap(map, time, actor);
return actor;
}
use of eidolons.libgdx.anims.particles.EmitterActor 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 eidolons.libgdx.anims.particles.EmitterActor in project Eidolons by IDemiurge.
the class AnimMultiplicator method applyMultiplicationForCoordinates.
public void applyMultiplicationForCoordinates(Set<Coordinates> coordinates) {
List<EmitterActor> list = new ArrayList<>();
filterCoordinates(template, coordinates).forEach(c -> {
for (EmitterActor e : emitterList) {
if (e.isGenerated()) {
continue;
}
EmitterActor actor = multiplicateEmitter(null, c, e);
list.add(actor);
}
});
list.forEach(a -> emitterList.add(a));
}
use of eidolons.libgdx.anims.particles.EmitterActor in project Eidolons by IDemiurge.
the class AnimMultiplicator method multiplicateEmitter.
private EmitterActor multiplicateEmitter(Integer angle, Coordinates c, EmitterActor e) {
EmitterActor actor = EmitterPools.getEmitterActor(e.path);
actor.setPosition(getX(), getY());
actor.setAttached(false);
actor.setGenerated(true);
ActorMaster.addRemoveAfter(actor);
anim.getMaster().addActor(actor);
if (angle != null) {
createAndAddEmitterActions(actor, angle, template);
} else {
createAndAddEmitterActions(actor, c);
}
return actor;
}
Aggregations