Skip to content
/ tid Public

A simple static timeline interpolation library.

License

Notifications You must be signed in to change notification settings

devwckd/tid

Repository files navigation

tid

A simple static timeline interpolation library.

Index

  1. Installation
    1. Gradle KTS
    2. Gradle Groovy
    3. Maven
  2. Usage
  3. Roadmap
  4. Spigot Support
  5. Contributing
  6. License
  7. Thanks

Installation

All artifacts are stored on Maven Central.

Gradle KTS

dependencies {
    implementation("me.devwckd.tid:tid-core:{latestVersion}")
}

Gradle Groovy

dependencies {
    implementation 'me.devwckd.tid:tid-core:{latestVersion}'
}

Maven

<dependencies>
    <dependency>
        <groupId>me.devwckd.tid</groupId>
        <artifactId>tid-core</artifactId>
        <version>{latestVersion}</version>
        <scope>compile</scope>
    </dependency>
</dependencies>

Usage

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

Roadmap

  • Add more easing functions (ref)
  • Add compute properties
  • Make a Json and/or Binary Serializer and Deserializer module

Spigot Support

Spigot support documentation is available in README_SPIGOT.md

Contributing

Pull request and issues are always appreciated.
Just make sure to explain what the changes you're proposing do on the description.

License

tid is free, open source and permissively licensed under the MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)

Thanks

Thanks for reading and using tid :)
Leave a ⭐ if it helped you.