A simple static timeline interpolation library.
All artifacts are stored on Maven Central.
dependencies {
implementation("me.devwckd.tid:tid-core:{latestVersion}")
}
dependencies {
implementation 'me.devwckd.tid:tid-core:{latestVersion}'
}
<dependencies>
<dependency>
<groupId>me.devwckd.tid</groupId>
<artifactId>tid-core</artifactId>
<version>{latestVersion}</version>
<scope>compile</scope>
</dependency>
</dependencies>
Sample usage
final Timeline timeline = TimelineBuilder.newBuilder()
.name("Cool Timeline") // Just for aesthetic purposes
.duration(20) // 20 frames, can be overrided by property keyframes.
.longProperty(
"linearLong",
builder -> builder
.keyframe(0, 0L)
.keyframe(25, 10L) // Overrides the duration
)
.doubleProperty(
"easeInDouble",
builder -> builder
.keyframe(0, 0.0, EasingInterpolator.EASE_IN) // Applies the EaseIn function to the keyframe
.keyframe(20, 50.0)
)
.build();
for (int i = 0; i < timeline.getDuration(); i++) {
final Properties properties = timeline.at(i);
final Long linearLong = properties.get("linearLong");
final Double easeInDouble = properties.get("easeInDouble");
}
- Add more easing functions (ref)
- Add compute properties
- Make a Json and/or Binary Serializer and Deserializer module
Spigot support documentation is available in README_SPIGOT.md
Pull request and issues are always appreciated.
Just make sure to explain what the changes you're proposing do on the description.
tid is free, open source and permissively licensed under the MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
Thanks for reading and using tid :)
Leave a ⭐ if it helped you.