My project is pretty much a 'mouse' only project. Like a point & click adventure game of sorts. The problem I'm having is Rpg Maker basically only has 2 options for mouse inputs. Left Click (inputOk), and Right Click (inputCancel/Menu). Normally in games like this Right Click is supposed to offer you some utility options.
I've currently disabled the right clicks ability to cancel/open the menu. I'm trying to make it open a common event, but it also needs to pass information to that common event. In my case I would like it to pass over the pictureId of the picture the mouse was hovered over at the time of the click.
So the things I'm currently missing are:
1. Finding out the current mouse X&Y. I'm assuming this has my answer:
If someone could confirm/deny and point me in the right direction I'd be very appreciative.
2. A way to compare the mouse X&Y to determine if a picture is beneath the mouse at the time of clicking. At the moment I'm not too concerned about transparent/alpha pixels. So long as the mouse is within the bounds of the pictures displayed dimensions (meaning it is relevant to the scale currently shown) it should be fine.
I know this is possible since there are a few plugins that have 'on hover' effects for pictures and they detect alpha/transparent pixels. Like VisuStella, or with Caethyril's plugin, but I couldn't quite discern what it was that made them work like that. So some help is needed.
I've currently disabled the right clicks ability to cancel/open the menu. I'm trying to make it open a common event, but it also needs to pass information to that common event. In my case I would like it to pass over the pictureId of the picture the mouse was hovered over at the time of the click.
So the things I'm currently missing are:
1. Finding out the current mouse X&Y. I'm assuming this has my answer:
JavaScript:
TouchInput._onRightButtonDown = function(event) {
const x = Graphics.pageToCanvasX(event.pageX); //<--- I'm assuming this would give me X position of mouse.
const y = Graphics.pageToCanvasY(event.pageY); //<--- Likewise this would give me Y position.
if (Graphics.isInsideCanvas(x, y)) {
this._onCancel(x, y);
}
};
2. A way to compare the mouse X&Y to determine if a picture is beneath the mouse at the time of clicking. At the moment I'm not too concerned about transparent/alpha pixels. So long as the mouse is within the bounds of the pictures displayed dimensions (meaning it is relevant to the scale currently shown) it should be fine.
I know this is possible since there are a few plugins that have 'on hover' effects for pictures and they detect alpha/transparent pixels. Like VisuStella, or with Caethyril's plugin, but I couldn't quite discern what it was that made them work like that. So some help is needed.