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(
self: SustainModel,
sustainCallback: function?--

Callback which should return a promise

) → ()

Sets the callback which will handle sustaining the animation.

SetIsSustained​

SustainModel.SetIsSustained(
self: SustainModel,
isSustained: boolean,
doNotAnimate: boolean?--

True if animation should be skipped

) → ()

Sets whether we should be sustaining or not

Sustain​

SustainModel.Sustain(
self: SustainModel,
doNotAnimate: boolean?--

True if animation should be skipped

) → ()

Starts sustaining

Stop​

SustainModel.Stop(
self: SustainModel,
doNotAnimate: boolean?--

True if animation should be skipped

) → ()

Stops sustaining

PromiseSustain​

SustainModel.PromiseSustain(
self: SustainModel,
doNotAnimate: boolean?--

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": "self",
                    "desc": "",
                    "lua_type": "SustainModel"
                },
                {
                    "name": "sustainCallback",
                    "desc": "Callback which should return a promise",
                    "lua_type": "function?"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 59,
                "path": "src/transitionmodel/src/Shared/Sustain/SustainModel.lua"
            }
        },
        {
            "name": "SetIsSustained",
            "desc": "Sets whether we should be sustaining or not",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "SustainModel"
                },
                {
                    "name": "isSustained",
                    "desc": "",
                    "lua_type": "boolean"
                },
                {
                    "name": "doNotAnimate",
                    "desc": "True if animation should be skipped",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 71,
                "path": "src/transitionmodel/src/Shared/Sustain/SustainModel.lua"
            }
        },
        {
            "name": "Sustain",
            "desc": "Starts sustaining",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "SustainModel"
                },
                {
                    "name": "doNotAnimate",
                    "desc": "True if animation should be skipped",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 85,
                "path": "src/transitionmodel/src/Shared/Sustain/SustainModel.lua"
            }
        },
        {
            "name": "Stop",
            "desc": "Stops sustaining",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "SustainModel"
                },
                {
                    "name": "doNotAnimate",
                    "desc": "True if animation should be skipped",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 94,
                "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": "self",
                    "desc": "",
                    "lua_type": "SustainModel"
                },
                {
                    "name": "doNotAnimate",
                    "desc": "True if animation should be skipped",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 106,
                "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": 9,
        "path": "src/transitionmodel/src/Shared/Sustain/SustainModel.lua"
    }
}