Skip to main content

SpringObject

This is like a Spring, but it can be observed, and emits events. It handles Observables and

Properties

Changed

SpringObject.Changed: Signal<()>--Fireswheneverthespringinitiallychangesstate

Event fires when the spring value changes

Functions

new

SpringObject.new(
targetT,
speednumber | Observable<number> | ValueObject<number> | NumberValue | any,
dampernumber | Observable<number> | NumberValue | any
) → Spring<T>

Constructs a new SpringObject.

The spring object is initially initialized as a spring at 0, with a target of 0. Upon setting a target or position, it will be initialized and begin emitting events.

If two observables emit different types the spring will retain the speed, damper, and switch to an initializes.

isSpringObject

SpringObject.isSpringObject(valueany) → boolean

Returns whether an object is a SpringObject.

ObserveRenderStepped

SpringObject:ObserveRenderStepped() → Observable<T>

Observes the spring animating

Observe

SpringObject:Observe() → Observable<T>

Alias for [ObserveRenderStepped]

ObserveTarget

SpringObject:ObserveTarget() → Observable<T>

Observes the current target of the spring

PromiseFinished

SpringObject:PromiseFinished(signalRBXScriptSignal | nil) → Observable<T>

Promises that the spring is done, based upon the animating property Relatively expensive.

ObserveOnSignal

SpringObject:ObserveOnSignal(signalRBXScriptSignal) → Observable<T>

Observes the spring animating

IsAnimating

SpringObject:IsAnimating() → boolean--

True if animating

Returns true when we're animating

Impulse

SpringObject:Impulse(
velocityT--

The velocity to impulse with

) → ()

Impulses the spring, increasing velocity by the amount given. This is useful to make something shake, like a Mac password box failing.

SetTarget

SpringObject:SetTarget(
targetT,--

The target to set

doNotAnimateboolean?--

Whether or not to animate

) → ()

Sets the actual target. If doNotAnimate is set, then animation will be skipped.

SetVelocity

SpringObject:SetVelocity(velocityT) → ()

Sets the velocity for the spring

SetPosition

SpringObject:SetPosition(positionT) → ()

Sets the position for the spring

SetDamper

SpringObject:SetDamper(dampernumber | Observable<number>) → ()

Sets the damper for the spring

SetSpeed

SpringObject:SetSpeed(speednumber | Observable<number>) → ()

Sets the damper for the spring

SetClock

SpringObject:SetClock(clock() → (number)) → ()

Sets the clock function for the spring

SetEpsilon

SpringObject:SetEpsilon(epsilonnumber) → ()

Sets the epsilon for the spring to stop animating

TimeSkip

SpringObject:TimeSkip(
deltanumber--

Time to skip forwards

) → ()

Instantly skips the spring forwards by that amount time

Destroy

SpringObject:Destroy() → ()

Cleans up the BaseObject and sets the metatable to nil

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new SpringObject.\n\nThe spring object is initially initialized as a spring at 0, with a target of 0. Upon setting\na target or position, it will be initialized and begin emitting events.\n\nIf two observables emit different types the spring will retain the speed, damper, and switch to\nan initializes.",
            "params": [
                {
                    "name": "target",
                    "desc": "",
                    "lua_type": "T"
                },
                {
                    "name": "speed",
                    "desc": "",
                    "lua_type": "number | Observable<number> | ValueObject<number> | NumberValue | any"
                },
                {
                    "name": "damper",
                    "desc": "",
                    "lua_type": "number | Observable<number> | NumberValue | any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Spring<T>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 39,
                "path": "src/blend/src/Shared/Blend/SpringObject.lua"
            }
        },
        {
            "name": "isSpringObject",
            "desc": "Returns whether an object is a SpringObject.",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 76,
                "path": "src/blend/src/Shared/Blend/SpringObject.lua"
            }
        },
        {
            "name": "ObserveRenderStepped",
            "desc": "Observes the spring animating",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<T>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 84,
                "path": "src/blend/src/Shared/Blend/SpringObject.lua"
            }
        },
        {
            "name": "Observe",
            "desc": "Alias for [ObserveRenderStepped]",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<T>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 93,
                "path": "src/blend/src/Shared/Blend/SpringObject.lua"
            }
        },
        {
            "name": "ObserveTarget",
            "desc": "Observes the current target of the spring",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<T>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 106,
                "path": "src/blend/src/Shared/Blend/SpringObject.lua"
            }
        },
        {
            "name": "PromiseFinished",
            "desc": "Promises that the spring is done, based upon the animating property\nRelatively expensive.",
            "params": [
                {
                    "name": "signal",
                    "desc": "",
                    "lua_type": "RBXScriptSignal | nil"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<T>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 137,
                "path": "src/blend/src/Shared/Blend/SpringObject.lua"
            }
        },
        {
            "name": "ObserveOnSignal",
            "desc": "Observes the spring animating",
            "params": [
                {
                    "name": "signal",
                    "desc": "",
                    "lua_type": "RBXScriptSignal"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<T>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 208,
                "path": "src/blend/src/Shared/Blend/SpringObject.lua"
            }
        },
        {
            "name": "IsAnimating",
            "desc": "Returns true when we're animating",
            "params": [],
            "returns": [
                {
                    "desc": "True if animating",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 235,
                "path": "src/blend/src/Shared/Blend/SpringObject.lua"
            }
        },
        {
            "name": "Impulse",
            "desc": "Impulses the spring, increasing velocity by the amount given. This is useful to make something shake,\nlike a Mac password box failing.",
            "params": [
                {
                    "name": "velocity",
                    "desc": "The velocity to impulse with",
                    "lua_type": "T"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "()"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 251,
                "path": "src/blend/src/Shared/Blend/SpringObject.lua"
            }
        },
        {
            "name": "SetTarget",
            "desc": "Sets the actual target. If doNotAnimate is set, then animation will be skipped.",
            "params": [
                {
                    "name": "target",
                    "desc": "The target to set",
                    "lua_type": "T"
                },
                {
                    "name": "doNotAnimate",
                    "desc": "Whether or not to animate",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 264,
                "path": "src/blend/src/Shared/Blend/SpringObject.lua"
            }
        },
        {
            "name": "SetVelocity",
            "desc": "Sets the velocity for the spring",
            "params": [
                {
                    "name": "velocity",
                    "desc": "",
                    "lua_type": "T"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 302,
                "path": "src/blend/src/Shared/Blend/SpringObject.lua"
            }
        },
        {
            "name": "SetPosition",
            "desc": "Sets the position for the spring",
            "params": [
                {
                    "name": "position",
                    "desc": "",
                    "lua_type": "T"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 328,
                "path": "src/blend/src/Shared/Blend/SpringObject.lua"
            }
        },
        {
            "name": "SetDamper",
            "desc": "Sets the damper for the spring",
            "params": [
                {
                    "name": "damper",
                    "desc": "",
                    "lua_type": "number | Observable<number>"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 353,
                "path": "src/blend/src/Shared/Blend/SpringObject.lua"
            }
        },
        {
            "name": "SetSpeed",
            "desc": "Sets the damper for the spring",
            "params": [
                {
                    "name": "speed",
                    "desc": "",
                    "lua_type": "number | Observable<number>"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 386,
                "path": "src/blend/src/Shared/Blend/SpringObject.lua"
            }
        },
        {
            "name": "SetClock",
            "desc": "Sets the clock function for the spring",
            "params": [
                {
                    "name": "clock",
                    "desc": "",
                    "lua_type": "() -> (number)"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 419,
                "path": "src/blend/src/Shared/Blend/SpringObject.lua"
            }
        },
        {
            "name": "SetEpsilon",
            "desc": "Sets the epsilon for the spring to stop animating",
            "params": [
                {
                    "name": "epsilon",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 437,
                "path": "src/blend/src/Shared/Blend/SpringObject.lua"
            }
        },
        {
            "name": "TimeSkip",
            "desc": "Instantly skips the spring forwards by that amount time",
            "params": [
                {
                    "name": "delta",
                    "desc": "Time to skip forwards",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "()"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 450,
                "path": "src/blend/src/Shared/Blend/SpringObject.lua"
            }
        },
        {
            "name": "Destroy",
            "desc": "Cleans up the BaseObject and sets the metatable to nil",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 607,
                "path": "src/blend/src/Shared/Blend/SpringObject.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "Changed",
            "desc": "Event fires when the spring value changes",
            "lua_type": "Signal<()> -- Fires whenever the spring initially changes state",
            "source": {
                "line": 51,
                "path": "src/blend/src/Shared/Blend/SpringObject.lua"
            }
        }
    ],
    "types": [],
    "name": "SpringObject",
    "desc": "This is like a [Spring], but it can be observed, and emits events. It handles [Observable]s and",
    "source": {
        "line": 6,
        "path": "src/blend/src/Shared/Blend/SpringObject.lua"
    }
}