Show raw api
{
"functions": [
{
"name": "new",
"desc": "A model that dictates the current state of a button.",
"params": [
{
"name": "button?",
"desc": "",
"lua_type": "GuiBase"
},
{
"name": "onUpdate",
"desc": "",
"lua_type": "function?"
}
],
"returns": [
{
"desc": "",
"lua_type": "ButtonHighlightModel"
}
],
"function_type": "static",
"source": {
"line": 58,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "SetButton",
"desc": "Sets the button for the highlight model.",
"params": [
{
"name": "button",
"desc": "",
"lua_type": "Instance"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 155,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "IsPressed",
"desc": "Gets if the button is pressed",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "boolean"
}
],
"function_type": "method",
"source": {
"line": 271,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "ObserveIsPressed",
"desc": "Observes if the button is pressed",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "Observable<boolean>"
}
],
"function_type": "method",
"source": {
"line": 279,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "ObservePercentPressed",
"desc": "Observes how pressed down the button is",
"params": [
{
"name": "acceleration",
"desc": "",
"lua_type": "number | nil"
}
],
"returns": [
{
"desc": "",
"lua_type": "Observable<number>"
}
],
"function_type": "method",
"source": {
"line": 289,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "ObservePercentPressedTarget",
"desc": "Observes target for how pressed the button is",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "Observable<number>"
}
],
"function_type": "method",
"source": {
"line": 302,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "IsHighlighted",
"desc": "Returns true if highlighted",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "boolean"
}
],
"function_type": "method",
"source": {
"line": 316,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "ObserveIsHighlighted",
"desc": "Observes if we're highlighted",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "Observable<boolean>"
}
],
"function_type": "method",
"source": {
"line": 325,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "ObservePercentHighlightedTarget",
"desc": "Observes target for how highlighted the button is",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "Observable<number>"
}
],
"function_type": "method",
"source": {
"line": 333,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "ObservePercentHighlighted",
"desc": "Observes how highlighted the button is",
"params": [
{
"name": "acceleration",
"desc": "",
"lua_type": "number | nil"
}
],
"returns": [
{
"desc": "",
"lua_type": "Observable<number>"
}
],
"function_type": "method",
"source": {
"line": 348,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "IsSelected",
"desc": "Returns true if selected",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "boolean"
}
],
"function_type": "method",
"source": {
"line": 357,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "ObserveIsSelected",
"desc": "Returns an observable for if we're selected",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "Observable<boolean>"
}
],
"function_type": "method",
"source": {
"line": 366,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "IsMouseOrTouchOver",
"desc": "Gets if mouse or touch is over specifically. This can be used\nfor hover effects.",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "Observable<boolean>"
}
],
"function_type": "method",
"source": {
"line": 376,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "ObserveIsMouseOrTouchOver",
"desc": "Observes if mouse or touch is over specifically. This can be used\nfor hover effects.",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "Observable<boolean>"
}
],
"function_type": "method",
"source": {
"line": 386,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "SetIsChoosen",
"desc": "Sets whether the model is choosen",
"params": [
{
"name": "isChoosen",
"desc": "",
"lua_type": "boolean"
},
{
"name": "doNotAnimate",
"desc": "",
"lua_type": "boolean"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 395,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "IsChoosen",
"desc": "Returns true if choosen",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "boolean"
}
],
"function_type": "method",
"source": {
"line": 406,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "ObserveIsChoosen",
"desc": "Observes if the instance is \"choosen\"",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "boolean"
}
],
"function_type": "method",
"source": {
"line": 415,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "ObservePercentChoosenTarget",
"desc": "Observes target for if the button is selected or not",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "Observable<number>"
}
],
"function_type": "method",
"source": {
"line": 423,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "ObservePercentChoosen",
"desc": "Observes how choosen the button is",
"params": [
{
"name": "acceleration",
"desc": "",
"lua_type": "number | nil"
}
],
"returns": [
{
"desc": "",
"lua_type": "Observable<number>"
}
],
"function_type": "method",
"source": {
"line": 438,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "SetInteractionEnabled",
"desc": "Sets whether interaction is enabled",
"params": [
{
"name": "interactionEnabled",
"desc": "",
"lua_type": "boolean"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 451,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "IsInteractionEnabled",
"desc": "Gets if interaction enabled",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "boolean"
}
],
"function_type": "method",
"source": {
"line": 459,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "ObserveIsInteractionEnabled",
"desc": "Observes if interaction enabled",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "Observable<boolean>"
}
],
"function_type": "method",
"source": {
"line": 467,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "SetKeyDown",
"desc": "Sets whether a key is down",
"params": [
{
"name": "isKeyDown",
"desc": "",
"lua_type": "boolean"
},
{
"name": "doNotAnimate",
"desc": "Optional",
"lua_type": "boolean"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 476,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
}
],
"properties": [
{
"name": "InteractionEnabledChanged",
"desc": "",
"lua_type": "Signal<boolean>",
"readonly": true,
"source": {
"line": 83,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "IsSelectedChanged",
"desc": "",
"lua_type": "Signal<boolean>",
"readonly": true,
"source": {
"line": 90,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "IsMouseOrTouchOverChanged",
"desc": "",
"lua_type": "Signal<boolean>",
"readonly": true,
"source": {
"line": 97,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "IsHighlightedChanged",
"desc": "",
"lua_type": "Signal<boolean>",
"readonly": true,
"source": {
"line": 104,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
},
{
"name": "IsPressedChanged",
"desc": "",
"lua_type": "Signal<boolean>",
"readonly": true,
"source": {
"line": 113,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
}
],
"types": [],
"name": "ButtonHighlightModel",
"desc": "Contains model information for the current button.\n\nUsage with Blend!\n\n```lua\nfunction Button.new()\n\tlocal self = setmetatable(BaseObject.new(), Button)\n\n\t-- Store the button model in the actual button so we can ensure it cleans up\n\t-- this assumes only one render. We can also construct it in the Button.Render\n\n\tself._buttonModel = ButtonHighlightModel.new()\n\tself._maid:GiveTask(self._buttonModel)\n\n\treturn self\nend\n\nfunction Button:Render()\n\t...\n\treturn Blend.New \"ImageButton\" {\n\t\t...\n\t\t[Blend.Instance] = function(button)\n\t\t\tself._buttonModel:SetButton(button)\n\t\tend;\n\t\tBackgroundTransparency = Blend.Computed(self._buttonModel:ObservePercentPressed(), function(pressed)\n\t\t\treturn 1 - pressed\n\t\tend);\n\t}\nend\n```",
"source": {
"line": 35,
"path": "src/buttonhighlightmodel/src/Client/ButtonHighlightModel.lua"
}
}