MV Check for User's Mouse Position?

I'm interested in making a point-and-click style RPG Maker MV game. But I'm trying to figure out how to run a check for the player's mouse X and Y position?
I want to make a button (using Show Picture command) that glows when you're hovering over it, and then responds when you click on it. But I'm not sure how to check for when the mouse is hovering over that particular area. Can this be accomplished in a script?
I'm new to Javascript coding so if anyone has an idea I'd appreciate it - thanks!
You could search for a number of mouse related plugins. With a quick google:



But I think for hover you can also just store the coordinates without the click in the mouse method (copy paste to notepad, save as .js file and add as a plugin). Then you can check TouchInput._hoverX and TouchInput._hoverY in a script. And for click you can check TouchInput.x and TouchInput.y
TouchInput._onMouseMove = function(event) {
if (this._mousePressed) {
var x = Graphics.pageToCanvasX(event.pageX);
var y = Graphics.pageToCanvasY(event.pageY);
this._onMove(x, y);
}
this._hoverX = Graphics.pageToCanvasX(event.pageX);
this._hoverY = Graphics.pageToCanvasY(event.pageY);
};
But I think for hover you can also just store the coordinates without the click in the mouse method (copy paste to notepad, save as .js file and add as a plugin). Then you can check TouchInput._hoverX and TouchInput._hoverY in a script.

Hi, hope this isn't a bother but this is exactly what I'm trying to do for my game! Would you be able to tell me the script command to use to check TouchInput._hoverX and Y? I don't know Javascript at all unfortunately.

Original thread: https://forums.rpgmakerweb.com/threads/check-for-users-mouse-position.182743/