Skip to main content

SustainModel

A sustain model is much like a TransitionModel but is responsible for sustaining some animation or state. Useful to represent the sustained state of an animation or something.

Functions

SetPromiseSustain

SustainModel:SetPromiseSustain(
sustainCallbackfunction?--

Callback which should return a promise

) → ()

Sets the callback which will handle sustaining the animation.

SetIsSustained

SustainModel:SetIsSustained(
isSustainedboolean,
doNotAnimateboolean?--

True if animation should be skipped

) → ()

Sets whether we should be sustaining or not

Sustain

SustainModel:Sustain(
doNotAnimateboolean?--

True if animation should be skipped

) → ()

Starts sustaining

Stop

SustainModel:Stop(
doNotAnimateboolean?--

True if animation should be skipped

) → ()

Stops sustaining

PromiseSustain

SustainModel:PromiseSustain(
doNotAnimateboolean?--

True if animation should be skipped

) → Promise

Starts sustaining. The promise will resolve when sustaining is done. If sustaining is already happening, it will not start, but will continue to sustain until the promise is done.

Show raw api
{
    "functions": [
        {
            "name": "SetPromiseSustain",
            "desc": "Sets the callback which will handle sustaining the animation.",
            "params": [
                {
                    "name": "sustainCallback",
                    "desc": "Callback which should return a promise",
                    "lua_type": "function?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 45,
                "path": "src/transitionmodel/src/Shared/Sustain/SustainModel.lua"
            }
        },
        {
            "name": "SetIsSustained",
            "desc": "Sets whether we should be sustaining or not",
            "params": [
                {
                    "name": "isSustained",
                    "desc": "",
                    "lua_type": "boolean"
                },
                {
                    "name": "doNotAnimate",
                    "desc": "True if animation should be skipped",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 57,
                "path": "src/transitionmodel/src/Shared/Sustain/SustainModel.lua"
            }
        },
        {
            "name": "Sustain",
            "desc": "Starts sustaining",
            "params": [
                {
                    "name": "doNotAnimate",
                    "desc": "True if animation should be skipped",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 71,
                "path": "src/transitionmodel/src/Shared/Sustain/SustainModel.lua"
            }
        },
        {
            "name": "Stop",
            "desc": "Stops sustaining",
            "params": [
                {
                    "name": "doNotAnimate",
                    "desc": "True if animation should be skipped",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 80,
                "path": "src/transitionmodel/src/Shared/Sustain/SustainModel.lua"
            }
        },
        {
            "name": "PromiseSustain",
            "desc": "Starts sustaining. The promise will resolve when sustaining is done.\nIf sustaining is already happening, it will not start, but will continue\nto sustain until the promise is done.",
            "params": [
                {
                    "name": "doNotAnimate",
                    "desc": "True if animation should be skipped",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 92,
                "path": "src/transitionmodel/src/Shared/Sustain/SustainModel.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "SustainModel",
    "desc": "A sustain model is much like a [TransitionModel] but is responsible for\nsustaining some animation or state. Useful to represent the sustained state\nof an animation or something.",
    "source": {
        "line": 8,
        "path": "src/transitionmodel/src/Shared/Sustain/SustainModel.lua"
    }
}