User Guide
Ruby Component
The example above shows how the mouse cursor changes to the default 'hand' to indicate that interaction is possible.
In this case we've elected to handle mouse events regardless of where the mouse pointer is in the View. However, you could use the x and y
position to return a different result depending on whether the mouse is in a particular area or location.
Mouse Clicks
Once you have your isInMousePoint method defined you'll receive an event whenever a mouse click occurs in the View (providing
isInMousePoint returns true for the particular point).
There are 6 methods for responding to standard mouse clicks, 3 for the left mouse button and 3 for the right. These are as follows:
mouseLDown - left mouse button clicked
mouseLUp - left mouse button released
mouseLDouble - left mouse button double-clicked
mouseRDown - left mouse button clicked
mouseRUp - left mouse button released
mouseRDouble - left mouse button double-clicked
Here we defined a left mouse button click method. We made it so that it outputs an array with the coordinates of the click point. You can see
that the mouse pointer is at 10 grid squares across and 5 down.
All the other mouse click methods work in the same way.
149 of 212