1.0.0 • Published 12 months ago

@firere/custom-tween v1.0.0

Weekly downloads
-
License
LGPL-2.1-or-later
Repository
github
Last release
12 months ago

CustomTween

A typed module which allows you to use tweens in Roblox with any easing function. It tries to behave as closely as possible to the behaviour of regular Tweens, including implementing the same methods and PlaybackStates.

Example usage

import CustomTween from "@firere/custom-tween";

const gui = new Instance("ScreenGui");
const box = new Instance("Frame");
box.Size = UDim2.fromOffset(100, 100);
box.Parent = gui;
gui.Parent = Players.LocalPlayer.FindFirstChild("PlayerGui") as PlayerGui;

const tween = new CustomTween(box, { time: 5, easing: (x) => 1 - math.pow(1 - x, 5) },  { Position: UDim2.fromScale(1, 0) });

tween.Play();
task.wait(2.5);
tween.Cancel();
1.0.0

12 months ago