{"id":"penguindevs/boattween","name":"boattween","scope":"penguindevs","platform":"roblox","description":"This module offers 32 easing styles (compared to Roblox's 11) and they all have the 3 easing directions as well, allowing you to find exactly the tween timing you desire. (same thing as nightcycle/boattween, except this package should work straight away instead of erroring without needing to edit the package's index)","version":"1.0.1","latest":"1.0.1","versions":["1.0.0","1.0.1"],"license":"MIT","licenseRating":"safe","licenseCaveats":["The package archive does not include its license text; the license is declared in its manifest metadata."],"licenseVerified":false,"dependencies":{},"integrity":"84813207c473e89006df4c499df12b2f11695e27811f07ea1a541c2d5b03893e","likes":0,"downloads":0,"install":"forest install penguindevs/boattween","url":"https://forest.dev/p/roblox/penguindevs/boattween","files":"https://api.forest.dev/ai/package/roblox/penguindevs/boattween/files","readme":"Before we begin, credit where credit is due. @howmanysmaII gave me various lerping and tweening algorithms, and they credit Fractality for various Lua functions, IBM + Google + Microsoft + Mozilla for the bezier curves, and Validark for rewriting certain equations.\r\n\r\nNow, into the module.\r\n\r\n# Why use this over Roblox’s TweenService?\r\n## Customization and power.\r\nThis module offers 32 easing styles (compared to Roblox’s 11) and they all have the 3 easing directions as well, allowing you to find exactly the tween timing you desire.\r\n\r\nThis module allows you to choose what event the tween runs on, so you can use Stepped, RenderStepped, or Heartbeat depending on your needs instead of being locked to Heartbeat with Roblox’s service.\r\n\r\nThis module allows you to tween nearly any value, including NumberRanges and PhysicalProperties, which makes it far more useful and versatile.\r\n\r\nThis module has more accurate color lerping than TweenService’s Color3:Lerp() method.\r\n\r\nThis module has events for Stopped, Completed, and Resumed on Tween objects but Roblox only has Completed which doesn’t differentiate between finishing and stopping.\r\n\r\nThis module offers all the usual tween features like reversing, repeating, and PlaybackState as well, so there are only gained features, not sacrifices.\r\n\r\n## Easier API.\r\nIt takes a dictionary (instead of a TweenInfo object) so you don’t need to make a new object and remember the parameter order every time you make a tween.\r\n\r\n# API:\r\n\r\n```plain\r\n-- BoatTween\r\n\r\nfunction BoatTween:Create(Object,Data)\r\n\treturns a Tween object\r\n\t\r\n\tParams:\r\n\t- Object\r\n\tThe instance that is having it's properties tweened\r\n\t- Data\r\n\tA dictionary of the various settings of the tween\r\n\t{\r\n\t\tnumber Time = Any positive number\r\n\t\t\tHow long the tween should take to complete\r\n\t\t\r\n\t\tstring EasingStyle = Any TweenStyle from the list below\r\n\t\t\tThe style that the tween follows\r\n\t\t\t(Note: Uses strings instead of Enum.EasingStyle to allow us to add styles that Roblox doesn't support)\r\n\t\t\t\r\n\t\tList of available styles:\r\n\t\t\t\tLinear\t\t\t\tQuad\t\t\t\t\tCubic\r\n\t\t\t\tQuart\t\t\t\tQuint\t\t\t\t\tSine\r\n\t\t\t\tExpo\t\t\t\tCirc\t\t\t\t\tElastic\r\n\t\t\t\tBack\t\t\t\tBounce\t\t\t\t\tSmooth\r\n\t\t\t\tSmoother\t\t\tRidiculousWiggle\t\tRevBack\r\n\t\t\t\tSpring\t\t\t\tSoftSpring\t\t\t\tStandard\r\n\t\t\t\tSharp\t\t\t\tAcceleration\t\t\tDeceleration\r\n\t\t\t\tStandardProductive\tEntranceProductive\t\tExitProductive\r\n\t\t\t\tStandardExpressive\tEntranceExpressive\t\tExitExpressive\r\n\t\t\t\tFabricStandard\t\tFabricAccelerate\t\tFabricDecelerate\r\n\t\t\t\tUWPAccelerate\t\tMozillaCurve\r\n\r\n\t\tstring EasingDirection = \"In\" or \"Out\" or \"InOut\"\r\n\t\t\tThe direction for the TweenStyle to adhere to\r\n\t\t\t\r\n\t\tnumber DelayTime = 0 -> math.huge\r\n\t\t\tThe amount of time before the tween begins playback after calling :Play() on the tween\r\n\t\t\t(Note: doesn't affect :Resume() calls)\r\n\t\t\r\n\t\tnumber RepeatCount = -1 -> math.huge\r\n\t\t\tHow many times the tween should repeat with -1 being infinity\r\n\t\t\t(Note: will wait the DelayTime in between replaying)\r\n\t\t\r\n\t\tboolean Reverses = false or true\r\n\t\t\tWhether the tween should reverse itself after completion\r\n\t\t\t(note: Waits the DelayTime before reversing)\r\n\t\t\t\r\n\t\ttable Goal = dictionary\r\n\t\t\tA dictionary where the keys are properties to tween and the values are the end goals of said properties\r\n\t\t\tYou may tween any property with value of the following types:\r\n\t\t\t\t\tnumber\t\t\t\tboolean\t\t\t\t\tCFrame\r\n\t\t\t\t\tColor3\t\t\t\tUDim2\t\t\t\t\tUDim\r\n\t\t\t\t\tRay\t\t\t\t\tNumberRange\t\t\t\tNumberSequenceKeypoint\r\n\t\t\t\t\tPhysicalProperties\tNumberSequence\t\t\tRegion3\r\n\t\t\t\t\tRect\t\t\t\tVector2\t\t\t\t\tVector3\r\n\t\t\t\t\t\r\n\t\t\t\r\n\t\tstring StepType = \"Stepped\" or \"Heartbeat\" or \"RenderStepped\"\r\n\t\t\tThe event of RunService for the tween to move on\r\n\t\t}\r\n\r\n-- Tween\r\n\r\nfunction Tween:Play()\r\n\tPlays the tween, starting from the beginning\r\nfunction Tween:Stop()\r\n\tStops the tween, freezing it in its current state\r\nfunction Tween:Resume()\r\n\tPlays the tween, starting from current position and time\r\nfunction TweenObject:Destroy()\r\n\tClears connections, stops playback, destroys objects\r\n\r\nproperty Tween.Instance\r\n\tThe object being tweened\r\nproperty Tween.PlaybackState\r\n\tAn Enum.PlaybackState representing the Tween's current state\r\n\t\r\nevent Tween.Stopped\r\n\tFired when a Tween ends from the :Stop() function\r\nevent Tween.Completed\r\n\tFired when a Tween ends due to :Play() being completed\r\nevent Tween.Resumed\r\n\tFired when a Tween is played through the :Resume() function\r\n```\r\n\r\n## Example:\r\n\r\n```Lua\r\nlocal BoatTween = require(script.BoatTween)\r\n\r\nlocal Tween = BoatTween:Create(workspace:WaitForChild(\"Part\"),{\r\n\tTime = 4;\r\n\tEasingStyle = \"EntranceExpressive\";\r\n\tEasingDirection = \"In\";\r\n\t\r\n\tReverses = true;\r\n\tDelayTime = 1;\r\n\tRepeatCount = 3;\r\n\t\r\n\tStepType = \"Heartbeat\";\r\n\t\r\n\tGoal = {\r\n\t\tColor = Color3.new(0.5,0.2,0.9);\r\n\t\tPosition = Vector3.new(4,10,7);\r\n\t\tTransparency = 0.5;\r\n\t};\r\n})\r\nTween:Play()\r\n```\r\n\r\n*Note: I didn’t test error cases carefully, because if you input invalid types and such that’s just your fault. TweenService would break too. Just don’t tell it to tween a Color3 to a Vector3 or something like that and you’ll be fine.*\r\n\r\nRemember to :Destroy() your tweens after usage!\r\n","readmeTruncated":false}