{"id":"maximumadhd/moonlite","name":"moonlite","scope":"maximumadhd","platform":"roblox","description":"A light-weight, runtime player for sequences created in Moon Animator 2.","version":"0.9.0","latest":"0.9.0","versions":["0.8.1","0.8.2","0.9.0"],"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":"dd141a1d5fe47420b8d16294f799e8030776bf11dadde9f23fd660e07ff937ff","likes":0,"downloads":0,"install":"forest install maximumadhd/moonlite","url":"https://forest.dev/p/roblox/maximumadhd/moonlite","files":"https://api.forest.dev/ai/package/roblox/maximumadhd/moonlite/files","readme":"<p align=\"center\">\r\n  <img src=\"https://i.imgur.com/rbdudpA.png\">\r\n</p>\r\n\r\n**Moonlite** is a light-weight, runtime player for sequences created in [**Moon Animator 2**](https://www.roblox.com/library/4725618216/Moon-Animator-2), a plugin developed by [@xsixx](https://twitter.com/xsixx).<br/>This project is actively developed and maintained by [@MaximumADHD](https://twitter.com/MaximumADHD).\r\n\r\n<br/>\r\n\r\n# Setup\r\n\r\n```lua\r\nMoonlite = require(game.ReplicatedStorage.Moonlite)\r\n```\r\nWhen syncing by default with rojo, the module can be found directly in the `ReplicatedStorage` service.\r\n\r\n\r\n## CreatePlayer\r\n```lua\r\nMoonlite.CreatePlayer(save: StringValue, root: Instance?) -> MoonTrack\r\n```\r\nLoads the provided save file to be played back. The `save` is a StringValue normally stored in `game.ServerStorage.MoonAnimator2Saves`, but you'll need to store it elsewhere to play the sequence back on the client.\r\n\r\n# MoonTrack\r\n```lua\r\ntype MoonTrack = Moonlite.MoonTrack\r\n```\r\n\r\n`MoonTrack` is the main type exported when requiring the `Moonlite` module. It represents a loaded animation sequence.\r\n\r\n## Play\r\n```ts\r\nMoonTrack:Play() -> ()\r\n```\r\nStarts playing the track's elements.\r\n>**Note:** Has no effect if the track is already playing.\r\n\r\n## Stop\r\n```ts\r\nMoonTrack:Stop() -> ()\r\n```\r\nStops all playing track elements.\r\n>**Note:** Has no effect if the track is already stopped.\r\n\r\n## Reset\r\n```ts\r\nMoonTrack:Reset() -> boolean\r\n```\r\nManually resets  all element's properties to their expected defaults. Returns `true` if the reset was successful.\r\n\r\n>**Note:** This will only work if the track is not playing.\r\n\r\n## IsPlaying\r\n```ts\r\nMoonTrack:IsPlaying() -> boolean\r\n```\r\nReturns `true` if the track has any elements playing.\r\n\r\n## GetElements\r\n```ts\r\nMoonTrack:GetElements() -> { Instance }\r\n```\r\nReturns an array of instances that can be modified by this track during playback.\r\n\r\n## LockElement\r\n```ts\r\nMoonTrack:LockElement(inst: Instance?, lock: any? = \"Default\") -> boolean\r\n```\r\nAdds a mutex lock to the provided element, disabling it from being modified by the track's playback. Returns `true` if the element is valid and successfully locked.\r\n\r\n>**Note:** If provided, the value of `lock` must be a truthy type (i.e. not `false` or `nil`), otherwise it will fallback to `\"Default\"`.\r\n>**Warning:** Calling this while the track is playing won't take effect until the track plays again.\r\n\r\n## UnlockElement\r\n```ts\r\nMoonTrack:UnlockElement(inst: Instance?, lock: any? = \"Default\") -> boolean\r\n```\r\n\r\nRemoves a mutex lock from the provided element, enabling it to be modified again if there are no other locks on it. Returns `true` if the element is valid and no longer has the provided lock.\r\n\r\n>**Note:** If provided, the value of `lock` must be a truthy type (i.e. not `false` or `nil`), otherwise it will fallback to `\"Default\"`.\r\n>**Warning:** Calling this while the track is playing won't take effect until the track plays again.\r\n\r\n## IsElementLocked\r\n```ts\r\nMoonTrack:IsElementLocked(inst: Instance?) -> boolean\r\n```\r\n\r\nReturns `true` if there are any locks on the provided element.\r\n\r\n## FindElement\r\n```ts\r\nMoonTrack:FindElement(name: string) -> Instance?\r\n```\r\nReturns the first element in this track whose name matches the provided name, if one can be found. Otherwise returns `nil`.\r\n\r\n>**Warning:** The result of this function depends on the order of elements in the authored sequence. If there are multiple elements with the same name, this may produce unexpected behavior.\r\n\r\n## FindElementOfType\r\n\r\n```ts\r\nMoonTrack:FindElementOfType(typeName: string): Instance?\r\n```\r\n\r\nReturns the first element in this track which satisfies `element:IsA(typeName)`, or `nil` if no such element can be found.\r\n\r\n>**Warning:** The result of this function depends on the order of elements in the authored sequence. If there are multiple elements that satisfy `element:IsA(typeName)`, this may produce unexpected behavior.\r\n\r\n## ReplaceElementByPath\r\n```ts\r\nMoonTrack:ReplaceElementByPath(path: string, replacement: Instance)\r\n```\r\n\r\nAttempts to replace an element by its defined absolute path with a specific Instance.\r\n\r\n## Looped\r\n```ts\r\nMoonliteTrack.Looped: boolean\r\n```\r\nIf set to `true`, this track's playback will loop on completion. This defaults to the value specified by the author of this sequence, and should be set explicitly if expected to behave one way or the other.\r\n\r\n---\r\n\r\n## Completed\r\n```ts\r\nMoonliteTrack.Completed: RBXScriptSignal\r\n```\r\nFires upon all of the track's elements completing their playback.\r\n\r\n---\r\n","readmeTruncated":false}