{"id":"zac134/moonlite","name":"moonlite","scope":"zac134","platform":"roblox","description":"A fork of moonlite to update wally. Original A light-weight, runtime player for sequences created in Moon Animator 2.","version":"0.9.14","latest":"0.9.14","versions":["0.9.1","0.9.11","0.9.12","0.9.13","0.9.14"],"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":"5e8be43932268808961a43fa4022bef97e362a7880126b1b6a08acf9a0addc0c","likes":0,"downloads":0,"install":"forest install zac134/moonlite","url":"https://forest.dev/p/roblox/zac134/moonlite","files":"https://api.forest.dev/ai/package/roblox/zac134/moonlite/files","readme":"<p align=\"center\">\n  <img src=\"https://i.imgur.com/rbdudpA.png\">\n</p>\n\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).\n\n<br/>\n\n# Installation\n\nIf you use Wally for managing packages, you can install it using the following line:\n\n```console\nMoonlite = \"maximumadhd/moonlite@0.9.0\"\n```\n\nIf you don't use Wally, you can install it from [Moonlite.rbxm](https://github.com/MaximumADHD/Moonlite/blob/main/Moonlite.rbxm) file.\n\n# Basic Usage\n\nCreate a `LocalScript` in `StarterPlayerScripts` with the following code:\n\n```luau\nlocal Moonlite = require(game.ReplicatedStorage.Moonlite)\n\nlocal save = game.ReplicatedStorage.MoonliteSaves.my_save\nlocal MoonTrack = Moonlite.CreatePlayer(save)\n\nMoonTrack:Play()\n```\n\nThe `save` is a StringValue normally stored in `game.ServerStorage.MoonAnimator2Saves`, but you'll want to use it on the client, so it's moved to `game.ReplicatedStorage.MoonliteSaves` for example.\n\n# Contribution\n\nWhen syncing by default with rojo, the module can be found directly in the `ReplicatedStorage` service.\n\n# APIs\n\n### CreatePlayer\n\n```luau\nMoonlite.CreatePlayer(save: StringValue, root: Instance?, options: CreateOptions?) -> MoonTrack\n```\n\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.\n\nThe `options` parameter accepts a table with the following fields:\n\n-   `ShouldCompileOnCreate: boolean?` - If set to `false`, the track will not be compiled immediately. Defaults to `true`.\n\n## MoonTrack\n\n```luau\ntype MoonTrack = Moonlite.MoonTrack\n```\n\n`MoonTrack` is the main type exported when requiring the `Moonlite` module. It represents a loaded animation sequence.\n\n### Play\n\n```luau\nMoonTrack:Play() -> ()\n```\n\nStarts playing the track's elements.\n\n> **Note:** Has no effect if the track is already playing.\n\n### Stop\n\n```luau\nMoonTrack:Stop() -> ()\n```\n\nStops all playing track elements.\n\n> **Note:** Has no effect if the track is already stopped.\n\n### Reset\n\n```luau\nMoonTrack:Reset() -> boolean\n```\n\nManually resets all element's properties to their expected defaults. Returns `true` if the reset was successful.\n\n> **Note:** This will only work if the track is not playing.\n\n### IsPlaying\n\n```luau\nMoonTrack:IsPlaying() -> boolean\n```\n\nReturns `true` if the track has any elements playing.\n\n### GetElements\n\n```luau\nMoonTrack:GetElements() -> { Instance }\n```\n\nReturns an array of instances that can be modified by this track during playback.\n\n### LockElement\n\n```luau\nMoonTrack:LockElement(inst: Instance?, lock: any? = \"Default\") -> boolean\n```\n\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.\n\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\"`.\n> **Warning:** Calling this while the track is playing won't take effect until the track plays again.\n\n### UnlockElement\n\n```luau\nMoonTrack:UnlockElement(inst: Instance?, lock: any? = \"Default\") -> boolean\n```\n\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.\n\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\"`.\n> **Warning:** Calling this while the track is playing won't take effect until the track plays again.\n\n### IsElementLocked\n\n```luau\nMoonTrack:IsElementLocked(inst: Instance?) -> boolean\n```\n\nReturns `true` if there are any locks on the provided element.\n\n### FindElement\n\n```luau\nMoonTrack:FindElement(name: string) -> Instance?\n```\n\nReturns the first element in this track whose name matches the provided name, if one can be found. Otherwise returns `nil`.\n\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.\n\n### FindElementOfType\n\n```luau\nMoonTrack:FindElementOfType(typeName: string): Instance?\n```\n\nReturns the first element in this track which satisfies `element:IsA(typeName)`, or `nil` if no such element can be found.\n\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.\n\n### ReplaceElementByPath\n\n```luau\nMoonTrack:ReplaceElementByPath(path: string, replacement: Instance) -> boolean\n```\n\nAttempts to replace an element by its defined absolute path with a specific Instance. Returns `true` if the element was successfully replaced.\n\n### GetTimeLength\n\n```luau\nMoonTrack:GetTimeLength() -> number\n```\n\nReturns the total length of the track in seconds.\n\n### GetMarkerReachedSignal\n\n```luau\nMoonTrack:GetMarkerReachedSignal(marker: string) -> RBXScriptSignal\n```\n\nReturns a signal that fires when the specified marker is reached during playback. The signal passes the target instance and marker data as parameters.\n\n### GetMarkerEndedSignal\n\n```luau\nMoonTrack:GetMarkerEndedSignal(marker: string) -> RBXScriptSignal\n```\n\nReturns a signal that fires when the specified marker ends during playback. The signal passes the target instance and marker data as parameters.\n\n### GetSetting\n\n```luau\nMoonTrack:GetSetting(name: string) -> any\n```\n\nRetrieves a custom setting value stored in the track's scratchpad.\n\n### SetSetting\n\n```luau\nMoonTrack:SetSetting(name: string, value: any) -> ()\n```\n\nStores a custom setting value in the track's scratchpad.\n\n### Destroy\n\n```luau\nMoonTrack:Destroy() -> ()\n```\n\nCleans up the track by destroying all internal signals and clearing data. Call this when you're done with the track to prevent memory leaks.\n\n### Looped\n\n```luau\nMoonTrack.Looped: boolean\n```\n\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.\n\n### Frames\n\n```luau\nMoonTrack.Frames: number\n```\n\nThe total number of frames in the track. This is read-only and set when the track is created.\n\n### FrameRate\n\n```luau\nMoonTrack.FrameRate: number\n```\n\nThe frame rate (FPS) of the track. This defaults to the value specified in the sequence, typically 60 FPS. This is read-only.\n\n### TimePosition\n\n```luau\nMoonTrack.TimePosition: number\n```\n\nThe current playback position in seconds. This can be read to get the current position or written to seek to a specific time.\n\n### RestoreDefaults\n\n```luau\nMoonTrack.RestoreDefaults: boolean\n```\n\nIf set to `true`, the track will restore element properties to their original values when stopped. This defaults to `true`.\n\n---\n\n### Completed\n\n```luau\nMoonTrack.Completed: RBXScriptSignal\n```\n\nFires upon all of the track's elements completing their playback. Passes a `PlaybackState` enum value indicating how the track completed (Completed, Cancelled, or Playing).\n\n---\n","readmeTruncated":false}