Class AbstractFadeModifier
java.lang.Object
dev.kosmx.playerAnim.api.layered.AnimationContainer<IAnimation>
dev.kosmx.playerAnim.api.layered.modifier.AbstractModifier
dev.kosmx.playerAnim.api.layered.modifier.AbstractFadeModifier
- All Implemented Interfaces:
IAnimation
Use with ModifierLayer.
Set an animation as a fade from.
length in ticks
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected @Nullable IAnimationAnimation to move from, null if transparent (easing in) use setBeginAnimation(IAnimation); //generated by Lombok pluginprotected intprotected intFields inherited from class dev.kosmx.playerAnim.api.layered.modifier.AbstractModifier
hostFields inherited from class dev.kosmx.playerAnim.api.layered.AnimationContainer
anim -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected floatcalculateProgress(float f) booleanstatic AbstractFadeModifierfunctionalFadeIn(int length, AbstractFadeModifier.EasingFunction function) Functional constructor for functional folks@NotNull Vec3fget3DTransform(@NotNull String modelName, @NotNull TransformType type, float tickDelta, @NotNull Vec3f value0) Get the transformed value to a model part, transform type.protected abstract floatgetAlpha(String modelName, TransformType type, float progress) Get the alpha at the given progressbooleanisActive()Is the animation currently active.voidsetupAnim(float tickDelta) Called before rendering a characterstatic AbstractFadeModifierstandardFadeIn(int length, Ease ease) Creates a standard fade with some easing in it.voidtick()Animation tick, on lag free client 20 [tick/sec] You can get the animations time from other places, but it will be invoked when the animation is ACTIVEMethods inherited from class dev.kosmx.playerAnim.api.layered.AnimationContainer
getAnim, getFirstPersonConfiguration, getFirstPersonMode, setAnim
-
Field Details
-
time
protected int time -
length
protected int length -
beginAnimation
Animation to move from, null if transparent (easing in) use setBeginAnimation(IAnimation); //generated by Lombok plugin
-
-
Constructor Details
-
AbstractFadeModifier
protected AbstractFadeModifier(int length)
-
-
Method Details
-
isActive
public boolean isActive()Description copied from interface:IAnimationIs the animation currently active. Tick will only be invoked when ACTIVE- Specified by:
isActivein interfaceIAnimation- Overrides:
isActivein classAnimationContainer<IAnimation>- Returns:
- active
-
canRemove
public boolean canRemove()- Overrides:
canRemovein classAbstractModifier- Returns:
- modifier can be removed.
-
setupAnim
public void setupAnim(float tickDelta) Description copied from interface:IAnimationCalled before rendering a character- Specified by:
setupAnimin interfaceIAnimation- Overrides:
setupAnimin classAnimationContainer<IAnimation>- Parameters:
tickDelta- Time since the last tick. 0-1
-
tick
public void tick()Description copied from interface:IAnimationAnimation tick, on lag free client 20 [tick/sec] You can get the animations time from other places, but it will be invoked when the animation is ACTIVE- Specified by:
tickin interfaceIAnimation- Overrides:
tickin classAnimationContainer<IAnimation>
-
get3DTransform
@NotNull public @NotNull Vec3f get3DTransform(@NotNull @NotNull String modelName, @NotNull @NotNull TransformType type, float tickDelta, @NotNull @NotNull Vec3f value0) Description copied from interface:IAnimationGet the transformed value to a model part, transform type.- Specified by:
get3DTransformin interfaceIAnimation- Overrides:
get3DTransformin classAnimationContainer<IAnimation>- Parameters:
modelName- The questionable model parttype- Transform typetickDelta- Time since the last tick. 0-1value0- The value before the transform. For identity transform return with it.- Returns:
- The new transform value
-
calculateProgress
protected float calculateProgress(float f) -
getAlpha
Get the alpha at the given progress- Parameters:
modelName- modelName if you want to handle parts differentlytype- Transform typeprogress- animation progress, float between 0 and 1- Returns:
- alpha, float between 0 and 1, lower value means less visible from animation
-
standardFadeIn
Creates a standard fade with some easing in it.- Parameters:
length- ease length in ticksease- ease function fromEase- Returns:
- fade modifier
-
functionalFadeIn
public static AbstractFadeModifier functionalFadeIn(int length, AbstractFadeModifier.EasingFunction function) Functional constructor for functional folks- Parameters:
length- ease lengthfunction- ease function- Returns:
- fade
-