Skip to content

Commit

Permalink
Added another example to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
EmeraldSlash committed Aug 27, 2021
1 parent 7b448b8 commit 5fd55d8
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,24 @@ RbxMouse.Button1Pressed:Connect(function(inputObject)
end)
```

Only allowing a button to be pressed by a single finger at once on mobile:
Prevent buttons being pressed by a click/tap starting elsewhere then being
dragged onto the button:

```lua
local button = gui.TextButton

button.InputBegan:Connect(function(inputObject)
if inputObject.UserInputType == Enum.UserInputType.Touch or
inputObject.UserInputType == Enum.UserInputType.MouseButton1
then
if BbxMouse:IsInputNew(inputObject) then
-- Your code here
end
end
end)
```

Only allow a button to be pressed by a single finger at once on mobile:

```lua
local button = gui.TextButton
Expand Down

0 comments on commit 5fd55d8

Please sign in to comment.