Search in sources :

Example 1 with ANIM_PART

use of eidolons.libgdx.anims.AnimationConstructor.ANIM_PART in project Eidolons by IDemiurge.

the class CompositeAnim method addEffectAnim.

public void addEffectAnim(Animation anim, Effect effect) {
    ANIM_PART partToAddAt = anim.getPart();
    if (part == null) {
        partToAddAt = EffectAnimCreator.getPartToAttachTo(effect);
    }
    if (effect.getRef().isTriggered()) {
        partToAddAt = EventAnimCreator.getPartToAttachTo(effect.getRef().getEvent());
    }
    float delay = EffectAnimCreator.getEffectAnimDelay(effect, anim, partToAddAt);
    attach(anim, partToAddAt, delay);
// anim group vs anim(Effects)
}
Also used : ANIM_PART(eidolons.libgdx.anims.AnimationConstructor.ANIM_PART)

Example 2 with ANIM_PART

use of eidolons.libgdx.anims.AnimationConstructor.ANIM_PART in project Eidolons by IDemiurge.

the class CompositeAnim method addEventAnim.

public void addEventAnim(Anim anim, Event event) {
    ANIM_PART partToAddAt = anim.getPart();
    if (partToAddAt == null) {
        partToAddAt = EventAnimCreator.getPartToAttachTo(event);
    }
    float delay = EventAnimCreator.getEventAnimDelay(event, anim, partToAddAt);
    attach(anim, partToAddAt, delay);
}
Also used : ANIM_PART(eidolons.libgdx.anims.AnimationConstructor.ANIM_PART)

Example 3 with ANIM_PART

use of eidolons.libgdx.anims.AnimationConstructor.ANIM_PART in project Eidolons by IDemiurge.

the class AnimMaster method getTriggerParentAnim.

private CompositeAnim getTriggerParentAnim(Event event) {
    CompositeAnim root = constructor.getOrCreate(event.getRef().getActive());
    if (root == null) {
        main.system.auxiliary.log.LogMaster.log(LogMaster.ANIM_DEBUG, "getTriggerParentAnim failed for: " + event);
        return null;
    }
    ANIM_PART part = EventAnimCreator.getPartToAttachTo(event);
    List<Animation> list = new ArrayList<>();
    if (root.getAttached().get(part) != null) {
        list.addAll(root.getAttached().get(part));
    }
    if (root.getTimeAttached().get(part) != null) {
        list.addAll(root.getTimeAttached().get(part));
    }
    int i = 0;
    for (Animation e : list) {
        if (e instanceof CompositeAnim) {
            return (CompositeAnim) e;
        }
        CompositeAnim a = new CompositeAnim();
        a.add(part, (Anim) e);
        if (e.getDelay() == 0) {
            root.getAttached().get(part).set(i, a);
        } else {
            root.getTimeAttached().get(part).set(i, a);
        }
        return a;
    }
    return root;
}
Also used : ANIM_PART(eidolons.libgdx.anims.AnimationConstructor.ANIM_PART) ArrayList(java.util.ArrayList)

Example 4 with ANIM_PART

use of eidolons.libgdx.anims.AnimationConstructor.ANIM_PART 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

ANIM_PART (eidolons.libgdx.anims.AnimationConstructor.ANIM_PART)4 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)1 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)1 Anim (eidolons.libgdx.anims.Anim)1 CompositeAnim (eidolons.libgdx.anims.CompositeAnim)1 ArrayList (java.util.ArrayList)1