Search

Categories

Mouse Hover

Vendor BTN
Category Utilities
Price Free

Description


Mouse Hover is a plugin for Corona projects that are targeting macOS and Windows. The plugin allows you to detect when the mouse cursor is hovering over display objects by adding a "mouseHover" event listener to them.

Here’s a short video showing it in action with three overlapping display objects. The objects light up when the mouse hover's over them with one of them blocking the propagation of the hover.


The mouseHover event captures the state of hovering by reporting a "began", "moved" or "ended" phase (event.phase). The event also provides a reference to the target object (event.target) and the cursor location (event.x and event.y).

The propagation of mouseHover events honors Corona's layered drawing model. The event starts at the foremost display object and works its way back. Children of a display group receive the event before their parent. As the event propagates, if any of the objects along the way return true in their event listeners, the propagation is stopped.


Objects that are not visible (i.e. object.isVisible set to false) and objects with an alpha value of 0 do not ordinarily receive mouseHover events. If you do want such objects to detect hovering, set their isHoverTestable property to true.

Last Updated
Sep 15, 2017
Date Added
Aug 25, 2017
Compatibility
Mac OS X 10 + , Windows 7 +