Files
Basalt/docs/docs1_6/objects/Object/onLeave.md
Robert Jelic d4c72514ef Docs 1.6
Accidentally uploaded outdated 1.6 docs
2023-05-01 16:28:46 +02:00

25 lines
535 B
Markdown

# Object - Event
## onLeave
`onLeave(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 onLeave event to your button:
```lua
local basalt = require("basalt")
local main = basalt.createFrame()
local button = main:addButton()
:setPosition(3,3)
:setSize(12,3)
:setText("Leave")
function buttonOnLeave()
basalt.debug("The mouse left the button!")
end
button:onLeave(buttonOnLeave)
```