Skip to main content

CameraStateTweener

Makes transitions between states easier. Uses the CameraStackService to tween in and out a new camera state Call :Show() and :Hide() to do so, and make sure to call :Destroy() after usage

Functions

new

CameraStateTweener.new(
serviceBagOrCameraStackServiceBag | CameraStack,--

Service bag to find the CameraStackService in

cameraEffectCameraLike,--

A camera effect

speednumber?--

Speed that the camera tweener tweens at. Defaults to 20

) → CameraStateTweener

Constructs a new camera state tweener

GetPercentVisible

CameraStateTweener:GetPercentVisible() → number

Returns percent visible, from 0 to 1.

Show

CameraStateTweener:Show(
doNotAnimate?boolean--

Optional, defaults to animating

) → ()

Shows the camera to fade in.

Hide

CameraStateTweener:Hide(
doNotAnimate?boolean--

Optional, defaults to animating

) → ()

Hides the camera to fade in.

IsFinishedHiding

CameraStateTweener:IsFinishedHiding() → boolean

Returns true if we're done hiding

IsFinishedShowing

CameraStateTweener:IsFinishedShowing() → boolean

Returns true if we're done showing

Finish

CameraStateTweener:Finish(
doNotAnimateboolean?,--

Optional, defaults to animating

callbackfunction
) → ()

Hides the tweener, and invokes the callback once the tweener is finished hiding.

GetCameraEffect

CameraStateTweener:GetCameraEffect() → CameraEffect

Gets the current effect we're tweening

GetCameraBelow

CameraStateTweener:GetCameraBelow() → CameraEffect

Gets the camera below this camera on the camera stack

SetTarget

CameraStateTweener:SetTarget(
targetnumber,
doNotAnimateboolean?--

Optional, defaults to animating

) → CameraStateTweener--

self

Sets the percent visible target

SetSpeed

CameraStateTweener:SetSpeed(speednumber) → CameraStateTweener--

self

Sets the speed of transition

SetVisible

CameraStateTweener:SetVisible(
isVisibleboolean,
doNotAnimateboolean?--

Optional, defaults to animating

) → ()

Sets whether the tweener is visible

GetFader

CameraStateTweener:GetFader() → CameraEffect

Retrieves the fading camera being used to interpolate.

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new camera state tweener",
            "params": [
                {
                    "name": "serviceBagOrCameraStack",
                    "desc": "Service bag to find the CameraStackService in",
                    "lua_type": "ServiceBag | CameraStack"
                },
                {
                    "name": "cameraEffect",
                    "desc": "A camera effect",
                    "lua_type": "CameraLike"
                },
                {
                    "name": "speed",
                    "desc": "Speed that the camera tweener tweens at. Defaults to 20",
                    "lua_type": "number?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "CameraStateTweener"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 29,
                "path": "src/camera/src/Client/Utility/CameraStateTweener.lua"
            }
        },
        {
            "name": "GetPercentVisible",
            "desc": "Returns percent visible, from 0 to 1.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 68,
                "path": "src/camera/src/Client/Utility/CameraStateTweener.lua"
            }
        },
        {
            "name": "Show",
            "desc": "Shows the camera to fade in.",
            "params": [
                {
                    "name": "doNotAnimate?",
                    "desc": "Optional, defaults to animating",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 76,
                "path": "src/camera/src/Client/Utility/CameraStateTweener.lua"
            }
        },
        {
            "name": "Hide",
            "desc": "Hides the camera to fade in.",
            "params": [
                {
                    "name": "doNotAnimate?",
                    "desc": "Optional, defaults to animating",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 84,
                "path": "src/camera/src/Client/Utility/CameraStateTweener.lua"
            }
        },
        {
            "name": "IsFinishedHiding",
            "desc": "Returns true if we're done hiding",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 92,
                "path": "src/camera/src/Client/Utility/CameraStateTweener.lua"
            }
        },
        {
            "name": "IsFinishedShowing",
            "desc": "Returns true if we're done showing",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 100,
                "path": "src/camera/src/Client/Utility/CameraStateTweener.lua"
            }
        },
        {
            "name": "Finish",
            "desc": "Hides the tweener, and invokes the callback once the tweener\nis finished hiding.",
            "params": [
                {
                    "name": "doNotAnimate",
                    "desc": "Optional, defaults to animating",
                    "lua_type": "boolean?"
                },
                {
                    "name": "callback",
                    "desc": "",
                    "lua_type": "function"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 110,
                "path": "src/camera/src/Client/Utility/CameraStateTweener.lua"
            }
        },
        {
            "name": "GetCameraEffect",
            "desc": "Gets the current effect we're tweening",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "CameraEffect"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 131,
                "path": "src/camera/src/Client/Utility/CameraStateTweener.lua"
            }
        },
        {
            "name": "GetCameraBelow",
            "desc": "Gets the camera below this camera on the camera stack",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "CameraEffect"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 139,
                "path": "src/camera/src/Client/Utility/CameraStateTweener.lua"
            }
        },
        {
            "name": "SetTarget",
            "desc": "Sets the percent visible target",
            "params": [
                {
                    "name": "target",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "doNotAnimate",
                    "desc": "Optional, defaults to animating",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [
                {
                    "desc": "self",
                    "lua_type": "CameraStateTweener"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 149,
                "path": "src/camera/src/Client/Utility/CameraStateTweener.lua"
            }
        },
        {
            "name": "SetSpeed",
            "desc": "Sets the speed of transition",
            "params": [
                {
                    "name": "speed",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "self",
                    "lua_type": "CameraStateTweener"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 163,
                "path": "src/camera/src/Client/Utility/CameraStateTweener.lua"
            }
        },
        {
            "name": "SetVisible",
            "desc": "Sets whether the tweener is visible",
            "params": [
                {
                    "name": "isVisible",
                    "desc": "",
                    "lua_type": "boolean"
                },
                {
                    "name": "doNotAnimate",
                    "desc": "Optional, defaults to animating",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 176,
                "path": "src/camera/src/Client/Utility/CameraStateTweener.lua"
            }
        },
        {
            "name": "GetFader",
            "desc": "Retrieves the fading camera being used to interpolate.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "CameraEffect"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 188,
                "path": "src/camera/src/Client/Utility/CameraStateTweener.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "CameraStateTweener",
    "desc": "Makes transitions between states easier. Uses the `CameraStackService` to tween in and\nout a new camera state Call `:Show()` and `:Hide()` to do so, and make sure to\ncall `:Destroy()` after usage",
    "source": {
        "line": 8,
        "path": "src/camera/src/Client/Utility/CameraStateTweener.lua"
    }
}