cage.input
Class MouseHandler

java.lang.Object
  extended by cage.input.MouseHandler
All Implemented Interfaces:
org.minueto.handlers.MinuetoMouseHandler

public class MouseHandler
extends java.lang.Object
implements org.minueto.handlers.MinuetoMouseHandler

Handles mouse clicks and checks clickable items in the current scene to see if something was hit.

Author:
Seth Marinello

Field Summary
static boolean editMode
          Edit mode allows the movement of spites with right click.
 
Constructor Summary
MouseHandler()
           
 
Method Summary
 void handleMouseMove(int iX, int iY)
          If an item is selected (in edit mode) the location of that selected item is updated to the location of the mouse pointer.
 void handleMousePress(int iX, int iY, int iButton)
          If the right button is clicked, the closest sprite is selected.
 void handleMouseRelease(int iX, int iY, int iButton)
          Called when the mouse is released.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

editMode

public static boolean editMode
Edit mode allows the movement of spites with right click.

Constructor Detail

MouseHandler

public MouseHandler()
Method Detail

handleMousePress

public void handleMousePress(int iX,
                             int iY,
                             int iButton)
If the right button is clicked, the closest sprite is selected. (Only in edit mode)

Specified by:
handleMousePress in interface org.minueto.handlers.MinuetoMouseHandler
Parameters:
iX - X position of press
iY - Y position of the press
iButton - The button pressed
See Also:
MinuetoMouse

handleMouseRelease

public void handleMouseRelease(int iX,
                               int iY,
                               int iButton)
Called when the mouse is released. If the left button is released, the location is compared to Sprites and HotSpots on the current Scene and the action is called for the furthest forward item hit by the click. If the right button is released, whatever was selected is deselected. Only useful in edit mode.

Specified by:
handleMouseRelease in interface org.minueto.handlers.MinuetoMouseHandler
Parameters:
iX - X position of release.
iY - Y position of the release
iButton - The button released
See Also:
MinuetoMouse

handleMouseMove

public void handleMouseMove(int iX,
                            int iY)
If an item is selected (in edit mode) the location of that selected item is updated to the location of the mouse pointer.

Specified by:
handleMouseMove in interface org.minueto.handlers.MinuetoMouseHandler
Parameters:
iX - X location
iY - Y location
See Also:
MinuetoMouse