use of eidolons.libgdx.anims.particles.EmitterActor in project Eidolons by IDemiurge.
the class MoonActor method initEmitters.
private void initEmitters() {
emitter = new EmitterActor(StrPathBuilder.build(PathFinder.getSfxPath(), "moons", moon.name()));
addActor(emitter);
float offsetX = getOffset();
float offsetY = getOffset();
emitter.start();
emitter.setSpeed(0.12f);
float size = getEmitterScale();
emitter.getEffect().getEmitters().get(0).scaleSize(size, size);
emitter.setPosition((FULL_SIZE / 2 + offsetX), (FULL_SIZE / 2 + offsetY));
circleEmitter = new EmitterActor(StrPathBuilder.build(PathFinder.getSfxPath(), "moons", "circle " + moon.name()));
addActor(circleEmitter);
offsetX = getOffset();
offsetY = getOffset();
circleEmitter.start();
circleEmitter.setSpeed(0.12f);
size = 1.4f;
// size =1/(size+2)/3;
circleEmitter.getEffect().getEmitters().get(0).scaleSize(size, size);
circleEmitter.setPosition((FULL_SIZE / 2 + offsetX), (FULL_SIZE / 2 + offsetY));
}
use of eidolons.libgdx.anims.particles.EmitterActor in project Eidolons by IDemiurge.
the class AnimMultiplicator method applyTemplateAngles.
private void applyTemplateAngles(Set<Coordinates> coordinates) {
int max = template.getNumberOfEmitters(getActive());
// 1 for ray, but we know coordinates precisely
List<EmitterActor> list = new ArrayList<>();
for (EmitterActor e : emitterList) {
int angle = 0;
for (Coordinates coordinate : coordinates) {
if (e.isGenerated()) {
continue;
}
EmitterActor actor = multiplicateEmitter(angle, coordinate, e);
angle += 360 / max;
list.add(actor);
}
}
list.forEach(a -> emitterList.add(a));
}
use of eidolons.libgdx.anims.particles.EmitterActor in project Eidolons by IDemiurge.
the class EmitterController method setForActive.
public void setForActive() {
String presetPath = new FileChooser(PathFinder.getSfxPath()).launch("", "");
// ImageChooser ic = new ImageChooser();
// ic.setDefaultFileLocation(PathFinder.getSfxPath()+"images//");
// String imagePath = ic.
ActiveObj active = DC_Game.game.getManager().getActiveObj().getRef().getActive();
CompositeAnim anim = AnimMaster.getInstance().getConstructor().getOrCreate(active);
// ANIM_PART part = ANIM_PART.IMPACT;
anim.getMap().keySet().forEach(part -> {
// anim.getMap().get(part).getData().setValue();
List<EmitterActor> list = EmitterPools.getEmitters(presetPath);
anim.getMap().get(part).setEmitterList(list);
});
// impact?
}
use of eidolons.libgdx.anims.particles.EmitterActor in project Eidolons by IDemiurge.
the class EditorParticleMaster method clicked.
public void clicked(int x, int y) {
String path = EditorMapView.getInstance().getGuiStage().getEmitterPalette().getSelectedEmitterPath();
EmitterActor last = particles.create(path, x, y);
last.start();
stack.push(last);
final DAY_TIME time = this.time;
last.addListener(new ClickListener() {
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
if (button == 1) {
removeEmitter(last, time);
}
return super.touchDown(event, x, y, pointer, button);
}
});
MapMaster.addToListMap(map, time, last);
// layer
// centering? emitters probably self-center...
last.setPosition(x, y);
layers.get(time).addActor(last);
GuiEventManager.trigger(MapEvent.EMITTER_CREATED, last);
}
use of eidolons.libgdx.anims.particles.EmitterActor in project Eidolons by IDemiurge.
the class MapMoveLayers method spawn.
private void spawn(MapMoveLayer container, int x, int y, int w, int h) {
x = RandomWizard.getRandomIntBetween(x, // can overlap!}
x + w);
y = RandomWizard.getRandomIntBetween(y, y + h);
addActor(container);
if (container.type.emitterPaths != null)
if (RandomWizard.random()) {
for (String sub : container.type.emitterPaths) {
EmitterActor emitter = new EmitterActor(sub);
container.addActor(emitter);
emitter.setPosition(container.getWidth() / 2, container.getHeight() / 2);
emitter.start();
emitter.getEffect().getEmitters().get(0).scaleSize(container.getScaleX() + 0.25f);
}
container.getContent().setZIndex(0);
}
container.setOriginalX(x);
container.setOriginalY(y);
container.getContent().setPosition(x, y);
container.setFluctuatingAlpha(0);
MapMaster.addToListMap(map, time, container);
if (isTinted(container)) {
tint(container.getColor());
}
// alpha to 0
}
Aggregations