Search in sources :

Example 1 with CompositeAnim

use of eidolons.libgdx.anims.CompositeAnim in project Eidolons by IDemiurge.

the class DC_SoundMaster method bindEvents.

public static void bindEvents() {
    GuiEventManager.bind(GuiEventType.ANIMATION_STARTED, p -> {
        Anim anim = (Anim) p.get();
        DC_ActiveObj activeObj = (DC_ActiveObj) anim.getActive();
        try {
            // TODO ON SEPARATE THREAD!!!!
            playAnimStartSound(activeObj, anim.getPart());
        } catch (Exception e) {
        // main.system.ExceptionMaster.printStackTrace(e);
        }
    });
    GuiEventManager.bind(GuiEventType.COMPOSITE_ANIMATION_STARTED, p -> {
        CompositeAnim anim = (CompositeAnim) p.get();
        DC_ActiveObj activeObj = (DC_ActiveObj) anim.getActive();
        try {
            playActionStartSound(activeObj);
        } catch (Exception e) {
            main.system.ExceptionMaster.printStackTrace(e);
        }
    });
}
Also used : DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) CompositeAnim(eidolons.libgdx.anims.CompositeAnim) Anim(eidolons.libgdx.anims.Anim) CompositeAnim(eidolons.libgdx.anims.CompositeAnim)

Example 2 with CompositeAnim

use of eidolons.libgdx.anims.CompositeAnim 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?
}
Also used : ActiveObj(main.entity.obj.ActiveObj) FileChooser(main.swing.generic.components.editors.FileChooser) EmitterActor(eidolons.libgdx.anims.particles.EmitterActor) CompositeAnim(eidolons.libgdx.anims.CompositeAnim)

Example 3 with CompositeAnim

use of eidolons.libgdx.anims.CompositeAnim in project Eidolons by IDemiurge.

the class FloatingTextMaster method addFloatingTextForEventAnim.

public void addFloatingTextForEventAnim(Event e, CompositeAnim compositeAnim) {
    TEXT_CASES CASE = getCase(e);
    if (CASE == null) {
        return;
    }
    ANIM_PART part = getPart(CASE);
    Anim anim = compositeAnim.getMap().get(part);
    if (anim == null) {
        if (compositeAnim.getMap().values().iterator().hasNext())
            return;
        anim = compositeAnim.getMap().values().iterator().next();
    }
    Object[] args = CASE.getArgs(e);
    DC_ActiveObj active = (DC_ActiveObj) e.getRef().getActive();
    float delay = 0;
    for (Object arg : args) {
        FloatingText floatingText = addFloatingText(active, CASE, arg, anim, delay);
        delay += floatingText.getDuration() / 2;
        LogMaster.log(1, e + "***** adding floating text for " + anim + " : " + floatingText);
    }
}
Also used : ANIM_PART(eidolons.libgdx.anims.AnimationConstructor.ANIM_PART) BattleFieldObject(eidolons.entity.obj.BattleFieldObject) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) Anim(eidolons.libgdx.anims.Anim) CompositeAnim(eidolons.libgdx.anims.CompositeAnim)

Aggregations

CompositeAnim (eidolons.libgdx.anims.CompositeAnim)3 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)2 Anim (eidolons.libgdx.anims.Anim)2 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)1 ANIM_PART (eidolons.libgdx.anims.AnimationConstructor.ANIM_PART)1 EmitterActor (eidolons.libgdx.anims.particles.EmitterActor)1 ActiveObj (main.entity.obj.ActiveObj)1 FileChooser (main.swing.generic.components.editors.FileChooser)1