npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@rbxts/moonlite

v1.0.4

Published

Moonlite typings

Downloads

3

Readme

Moonlite is a light-weight, runtime player for sequences created in Moon Animator 2, a plugin developed by @xsixx.This project is actively developed and maintained by @MaximumADHD.

Setup

Moonlite = require(game.ReplicatedStorage.Moonlite)

When syncing by default with rojo, the module can be found directly in the ReplicatedStorage service.

CreatePlayer

Moonlite.CreatePlayer(save: StringValue, root: Instance?) -> MoonTrack

Loads 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.

MoonTrack

type MoonTrack = Moonlite.MoonTrack

MoonTrack is the main type exported when requiring the Moonlite module. It represents a loaded animation sequence.

Play

MoonTrack:Play() -> ()

Starts playing the track's elements.

Note: Has no effect if the track is already playing.

Stop

MoonTrack:Stop() -> ()

Stops all playing track elements.

Note: Has no effect if the track is already stopped.

Reset

MoonTrack:Reset() -> boolean

Manually resets all element's properties to their expected defaults. Returns true if the reset was successful.

Note: This will only work if the track is not playing.

IsPlaying

MoonTrack:IsPlaying() -> boolean

Returns true if the track has any elements playing.

GetElements

MoonTrack:GetElements() -> { Instance }

Returns an array of instances that can be modified by this track during playback.

LockElement

MoonTrack:LockElement(inst: Instance?, lock: any? = "Default") -> boolean

Adds 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.

Note: If provided, the value of lock must be a truthy type (i.e. not false or nil), otherwise it will fallback to "Default". Warning: Calling this while the track is playing won't take effect until the track plays again.

UnlockElement

MoonTrack:UnlockElement(inst: Instance?, lock: any? = "Default") -> boolean

Removes 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.

Note: If provided, the value of lock must be a truthy type (i.e. not false or nil), otherwise it will fallback to "Default". Warning: Calling this while the track is playing won't take effect until the track plays again.

IsElementLocked

MoonTrack:IsElementLocked(inst: Instance?) -> boolean

Returns true if there are any locks on the provided element.

FindElement

MoonTrack:FindElement(name: string) -> Instance?

Returns the first element in this track whose name matches the provided name, if one can be found. Otherwise returns nil.

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.

FindElementOfType

MoonTrack:FindElementOfType(typeName: string): Instance?

Returns the first element in this track which satisfies element:IsA(typeName), or nil if no such element can be found.

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.

ReplaceElementByPath

MoonTrack:ReplaceElementByPath(path: string, replacement: Instance)

Attempts to replace an element by its defined absolute path with a specific Instance.

Looped

MoonliteTrack.Looped: boolean

If 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.


Completed

MoonliteTrack.Completed: RBXScriptSignal

Fires upon all of the track's elements completing their playback.