Files
Basalt/docs/objects/Object/onScroll.md
Robert Jelic ab72f244ed Updated some formatting
Updated formatting for object
2022-10-20 21:05:29 +02:00

25 lines
503 B
Markdown

# Object - Event
## onScroll
`onScroll(self, event, direction, x, y)`
The computercraft event which triggers this method is `mouse_scroll`.
Here is a example on how to add a onScroll event to your button:
```lua
local basalt = require("basalt")
local main = basalt.createFrame()
local button = main:addButton()
:setPosition(3,3)
:setSize(12,3)
:setText("Click")
function buttonOnScroll(self, direction, x, y)
basalt.debug("Someone scrolls on me!")
end
button:onScroll(buttonOnScroll)
```