Class Timeline.Builder
java.lang.Object
com.github.darksoulq.abyssallib.world.particle.timeline.Timeline.Builder
- Enclosing class:
Timeline
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(long start, long duration, Transformer transformer) Adds a transformation segment to the timeline.build()Constructs the finalTimelineinstance.duration(long ticks) Sets the total duration of the timeline.loop(boolean loop) Sets whether the timeline should loop.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
duration
Sets the total duration of the timeline. Note: Adding a keyframe that exceeds this will automatically increase the duration.- Parameters:
ticks- The duration in ticks.- Returns:
- This builder.
-
loop
Sets whether the timeline should loop.- Parameters:
loop- True to loop, false to stop at the end.- Returns:
- This builder.
-
add
Adds a transformation segment to the timeline.- Parameters:
start- The tick at which the transformation should begin.duration- The number of ticks the transformation should remain active.transformer- TheTransformerlogic to apply.- Returns:
- This builder.
-
build
-