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)
}
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);
}
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;
}
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);
}
}
Aggregations