Button:onHover(x, y) event


This event is fired when the user moves the mouse pointer over the Button.

Parameters

x

The horizontal position of the mouse in the Button area (zero means the left border of the widget).

y

The vertical position of the mouse in the Button area (zero means the top border of the widget).

Return value

The event returns no value.

Example

local ui = require "ui" -- create a window local win = ui.Window("Button:onHover() sample", 320, 200) local button = ui.Button(win, "Move the mouse over this text!", 80, 75) -- set a onClick() event : display a status bar with the mouse position when the user hovers the button function button:onHover(x, y) win:status("Mouse position : "..x..", "..y) end win:show() while win.visible do ui.update() end