Class AnimationTimeline
java.lang.Object
dev.bouncingelf10.timelesslib.api.animation.AnimationTimeline
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbindDouble(String channelName, Consumer<Double> consumer) Binds a double consumer to the specified channel.Binds a Vec3 consumer to the specified channel.channelDouble(String name) Adds a new double channel to the timeline.channelVec3(String name) Adds a new Vec3 channel to the timeline.defaultEasing(Easing easing) Sets the default easing for the timeline.defaultInterpolation(Interpolation interpolation) Sets the default interpolation for the timeline.doubleid()booleanbooleanloop(boolean enabled) Adds a callback to be executed when the timeline finishes playing.Adds a callback to be executed when the timeline loops.Adds a callback to be executed when the timeline starts playing.voidpause()voidToggles between playing and paused.pingPong(boolean enabled) voidplay()voidvoidseek(double seconds) Seeks to the specified time in seconds.voidSeeks to the specified duration.setTimeSource(TimeSource source) Sets the defaultTimeSourcefor the timeline.speed(double speed) voidstop()voidupdate(double deltaSeconds) You don't need to call this.
-
Constructor Details
-
AnimationTimeline
-
-
Method Details
-
id
-
loop
-
pingPong
-
speed
-
defaultInterpolation
Sets the default interpolation for the timeline.
Note: Channels can override these settings and follow a hierarchy:
AnimationTimeline>ChannelDouble>KeyframeDouble(same for Vec3) -
defaultEasing
Sets the default easing for the timeline.
Note: Channels can override these settings and follow a hierarchy:
AnimationTimeline>ChannelDouble>KeyframeDouble(same for Vec3) -
onStart
Adds a callback to be executed when the timeline starts playing.- Parameters:
callback- Callback to execute
-
onLoop
Adds a callback to be executed when the timeline loops.- Parameters:
callback- Callback to execute
-
onFinish
Adds a callback to be executed when the timeline finishes playing.- Parameters:
callback- Callback to execute
-
isPlaying
public boolean isPlaying() -
isFinished
public boolean isFinished() -
play
public void play() -
pause
public void pause() -
stop
public void stop() -
playOrReset
public void playOrReset() -
pauseOrUnpause
public void pauseOrUnpause()Toggles between playing and paused. -
seek
public void seek(double seconds) Seeks to the specified time in seconds. Note: "Seeking" to a time means that the timeline will jump to that time instantly. -
seek
Seeks to the specified duration. Note: "Seeking" to a time means that the timeline will jump to that time instantly. -
channelDouble
Adds a new double channel to the timeline.- Parameters:
name- Channel name- Returns:
ChannelDouble
-
channelVec3
Adds a new Vec3 channel to the timeline.- Parameters:
name- Channel name- Returns:
ChannelVec3
-
getDoubleChannels
-
getVec3Channels
-
update
public void update(double deltaSeconds) You don't need to call this. Its taken care of by theAnimationManager. -
getDurationSeconds
public double getDurationSeconds() -
setTimeSource
Sets the defaultTimeSourcefor the timeline.
Note: Channels can override these settings and follow a hierarchy:
AnimationTimeline>ChannelDouble>KeyframeDouble(same for Vec3) -
bindDouble
Binds a double consumer to the specified channel.
Normally you should call this in the channel itselfChannelDouble.bind(Consumer)and I advise you to not use this method. -
bindVec3
public AnimationTimeline bindVec3(String channelName, Consumer<net.minecraft.world.phys.Vec3> consumer) Binds a Vec3 consumer to the specified channel.
Normally you should call this in the channel itselfChannelVec3.bind(Consumer)and I advise you to not use this method.
-