ch.aplu.jgamegrid
Interface GGMouseTouchListener

All Superinterfaces:
java.util.EventListener
All Known Implementing Classes:
Hand

public interface GGMouseTouchListener
extends java.util.EventListener

Declarations of the notification method called when the mouse interacts with the actor's mouse touch area.
(Cannot be used with Jython's constructor callback registration)


Method Summary
 void mouseTouched(Actor actor, GGMouse mouse, java.awt.Point spot)
          Event callback method to report events with the mouse touch area of an actor's sprite.
 

Method Detail

mouseTouched

void mouseTouched(Actor actor,
                  GGMouse mouse,
                  java.awt.Point spot)
Event callback method to report events with the mouse touch area of an actor's sprite. Mouse touch area types available: IMAGE (default, events on non-transparent pixels of sprite image), RECTANGLE, CIRCLE. The non-default types can be selected for each sprite ID with Actor.setMouseTouchRectangle(), Actor.setMouseTouchCircle(). The parameter mouse is used to get the type of the mouse event and the current mouse cursor position. spot contains the event coordinates relative to the mouse touch area with the following fixed coordinate system: x-axis to the left, y-axis downward, origin at center of mouse touch area. The actor's location offset is respected.

If the mouse touch area of several actors overlays, all actors get the notification unless the MouseTouchListener is registered by setting the onTopOnly flag to true.

Move events are not reported. Drag events ar only reported if the mouse was pressed inside the mouse touch area.

Parameters:
actor - the reference of the actor that reports the touch
mouse - the mouse reference to get to get information about the event
spot - the pixel coordinates relative to the mouse touch area where the event occurred