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

25 lines
542 B
Markdown

# Object - Event
## onHover
`onHover(self, event, button, x, y)`
The computercraft event which triggers this method is `mouse_move` - only available in [CraftOS-PC](https://www.craftos-pc.cc).
Here is a example on how to add a onHover event to your button:
```lua
local basalt = require("basalt")
local main = basalt.createFrame()
local button = main:addButton()
:setPosition(3,3)
:setSize(12,3)
:setText("Hover")
function buttonOnHover()
basalt.debug("The mouse hovers over the button!")
end
button:onHover(buttonOnHover)
```