Search in sources :

Example 16 with EmitterActor

use of eidolons.libgdx.anims.particles.EmitterActor in project Eidolons by IDemiurge.

the class EmitterController method add.

public void add(String presetPath, String imagePath) {
    EmitterActor actor = null;
    try {
        actor = new EmitterActor(presetPath, true) {

            @Override
            public void draw(Batch batch, float parentAlpha) {
                act(Gdx.graphics.getDeltaTime());
                // Vector2 v = GridMaster.getMouseCoordinates();
                // setPosition(v.x, v.y);
                super.draw(batch, parentAlpha);
            }
        };
    } catch (Exception e) {
        main.system.ExceptionMaster.printStackTrace(e);
        return;
    }
    if (imagePath != null) {
        actor.getEffect().setImagePath(imagePath);
    }
    add(actor, null);
}
Also used : Batch(com.badlogic.gdx.graphics.g2d.Batch) EmitterActor(eidolons.libgdx.anims.particles.EmitterActor)

Example 17 with EmitterActor

use of eidolons.libgdx.anims.particles.EmitterActor in project Eidolons by IDemiurge.

the class EmitterController method modify.

private void modify(SFX_MODIFICATION_PRESET preset) {
    EMITTER_VALUE_GROUP group = getValGroup(preset);
    String val = getValue(preset);
    String modVals = (val == null) ? "" : group + EmitterPresetMaster.value_separator + val;
    EmitterActor newActor = EmitterPresetMaster.getInstance().getModifiedEmitter(last.path, true, modVals);
    if (val == null) {
        newActor.getEffect().toggle(group.getFieldName());
    }
    add(newActor, new Vector2(last.getX() + // newActor.getEffect().getBoundingBox().getWidth()
    100, last.getY()));
}
Also used : Vector2(com.badlogic.gdx.math.Vector2) EmitterActor(eidolons.libgdx.anims.particles.EmitterActor) EMITTER_VALUE_GROUP(eidolons.libgdx.anims.particles.EmitterPresetMaster.EMITTER_VALUE_GROUP)

Aggregations

EmitterActor (eidolons.libgdx.anims.particles.EmitterActor)17 Vector2 (com.badlogic.gdx.math.Vector2)3 Actor (com.badlogic.gdx.scenes.scene2d.Actor)2 DAY_TIME (main.content.enums.macro.MACRO_CONTENT_CONSTS.DAY_TIME)2 Coordinates (main.game.bf.Coordinates)2 Batch (com.badlogic.gdx.graphics.g2d.Batch)1 ParticleEmitter (com.badlogic.gdx.graphics.g2d.ParticleEmitter)1 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)1 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)1 CompositeAnim (eidolons.libgdx.anims.CompositeAnim)1 EMITTER_VALUE_GROUP (eidolons.libgdx.anims.particles.EmitterPresetMaster.EMITTER_VALUE_GROUP)1 MAP_POINTS (eidolons.libgdx.screens.map.layers.MapMoveLayers.MAP_POINTS)1 ActiveObj (main.entity.obj.ActiveObj)1 FileChooser (main.swing.generic.components.editors.FileChooser)1 DequeImpl (main.system.datatypes.DequeImpl)1