Skip to main content

ButtonDragModel

Computes the position of a user dragging a button around

Functions

new

ButtonDragModel.new(
initialButtonGuiButton?--

Optional

) → ButtonDragModel

Construst a new drag model for the button

IsPressed

ButtonDragModel.IsPressed(selfButtonDragModel) → boolean

Returns true if pressed

ObserveIsPressed

ButtonDragModel.ObserveIsPressed(selfButtonDragModel) → Observable<boolean>

Observes if anything is pressing down on the button itself

ObserveIsPressedBrio

ButtonDragModel.ObserveIsPressedBrio(selfButtonDragModel) → Observable<Brio<true>>

ObserveDragDelta

ButtonDragModel.ObserveDragDelta(selfButtonDragModel) → Observable<Vector2?>

GetDragDelta

ButtonDragModel.GetDragDelta(selfButtonDragModel) → Vector2?

GetDragPosition

ButtonDragModel.GetDragPosition(selfButtonDragModel) → Vector2?

Returns the scale position on the Gui from 0 to 1

This is reletive to the GUI, so top left is 0, 0

ObserveDragPosition

ButtonDragModel.ObserveDragPosition(selfButtonDragModel) → Observable<Vector2?>

Observes the scale position on the Gui from 0 to 1

This is reletive to the GUI, so top left is 0, 0

SetClampWithinButton

ButtonDragModel.SetClampWithinButton(
clampWithinButtonboolean
) → ()

Sets whether to clamp the results within the button bounds

SetButton

ButtonDragModel.SetButton(
buttonGuiButton
) → () → ()--

Cleanup function

Sets the current button for the model

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Construst a new drag model for the button",
            "params": [
                {
                    "name": "initialButton",
                    "desc": "Optional",
                    "lua_type": "GuiButton?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ButtonDragModel"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 47,
                "path": "src/buttondragmodel/src/Client/ButtonDragModel.lua"
            }
        },
        {
            "name": "IsPressed",
            "desc": "Returns true if pressed",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ButtonDragModel"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 93,
                "path": "src/buttondragmodel/src/Client/ButtonDragModel.lua"
            }
        },
        {
            "name": "ObserveIsPressed",
            "desc": "Observes if anything is pressing down on the button itself",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ButtonDragModel"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<boolean>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 102,
                "path": "src/buttondragmodel/src/Client/ButtonDragModel.lua"
            }
        },
        {
            "name": "ObserveIsPressedBrio",
            "desc": "",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ButtonDragModel"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Brio<true>>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 109,
                "path": "src/buttondragmodel/src/Client/ButtonDragModel.lua"
            }
        },
        {
            "name": "ObserveDragDelta",
            "desc": "",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ButtonDragModel"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Vector2?>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 118,
                "path": "src/buttondragmodel/src/Client/ButtonDragModel.lua"
            }
        },
        {
            "name": "GetDragDelta",
            "desc": "",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ButtonDragModel"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Vector2?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 125,
                "path": "src/buttondragmodel/src/Client/ButtonDragModel.lua"
            }
        },
        {
            "name": "GetDragPosition",
            "desc": "Returns the scale position on the Gui from 0 to 1\n\nThis is reletive to the GUI, so top left is 0, 0",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ButtonDragModel"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Vector2?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 136,
                "path": "src/buttondragmodel/src/Client/ButtonDragModel.lua"
            }
        },
        {
            "name": "ObserveDragPosition",
            "desc": "Observes the scale position on the Gui from 0 to 1\n\nThis is reletive to the GUI, so top left is 0, 0",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ButtonDragModel"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Vector2?>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 147,
                "path": "src/buttondragmodel/src/Client/ButtonDragModel.lua"
            }
        },
        {
            "name": "SetClampWithinButton",
            "desc": "Sets whether to clamp the results within the button bounds",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ButtonDragModel"
                },
                {
                    "name": "clampWithinButton",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 155,
                "path": "src/buttondragmodel/src/Client/ButtonDragModel.lua"
            }
        },
        {
            "name": "SetButton",
            "desc": "Sets the current button for the model",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ButtonDragModel"
                },
                {
                    "name": "button",
                    "desc": "",
                    "lua_type": "GuiButton"
                }
            ],
            "returns": [
                {
                    "desc": "Cleanup function",
                    "lua_type": "() -> ()"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 165,
                "path": "src/buttondragmodel/src/Client/ButtonDragModel.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "ButtonDragModel",
    "desc": "Computes the position of a user dragging a button around",
    "source": {
        "line": 7,
        "path": "src/buttondragmodel/src/Client/ButtonDragModel.lua"
    }
}