Overlapeventhandler - Adobe ATMOSPHERE User Manual

Table of Contents

Advertisement

Local Callbacks
onEvent(mouseEvent, what)
A method which defi nes what will happen when the mouse event occurs. An event object is returned which
possesses numerous properties, and the object under the mouse is returned as the second argument.
myEventHandler = MouseEventHandler();
myEventHandler.setFilterOnClick(stageModel);
myEventHandler.onEvent = function(mouseEvent, what)
{
chat.print("Object = " + what);
dump(mouseEvent);
}
If the above onEvent function is called as shown, a 'dump' of the mouseEvent will return the following
properties, which can in turn be used to control other logic for the event:
buttonLeftDown
buttonMiddleDown
buttonRightDown
clickDown
clickEvent
clickUp
metaKey1Down
metaKey2Down
metaKey3Down
metaKey4Down
x
y

OverlapEventHandler

An OverlapEventHandler is an object that can be used to specify what happens when two or more physical objects
overlap each other. Numerous OverlapEventHandler's can be created, each specifying results for a limited scope of
events (set by the fi ltering methods shown below).
An OverlapEventHandler has onEnter and onLeave methods, which is where the actions are defi ned forthe results
of either event. By default, an OverlapEventHandler handles all events in a world. Use the local fi lter methods shown
below tolimit event handling to specifi c physical models.
Note: Enabling an OverlapEventHandler() for a specifi c physical model will also disable collision with that physical
model; the two are mutually exclusive. It is not possible to collide with and object and also intersect with it at the
same time.
Global Methods
OverlapEventHandler()
Creates a new OverlapEventHandler (which possesses onEnter, onLeave, and fi ltering methods).
// true or false state of the left mouse button
// true or false state of the middle mouse button
// (currently always false)
// true for mouse down event, and false for mouse up
// acts as a 'type' identifi er, and returns true for all click events
// true for mouse up event, and false for mouse down
// true if 'Shift' key was also held down during click event
// true if 'Ctrl' key was also held down during click event
// (currently not used)
// (currently not used)
// the x-axis pixel position of the mouse during the click event
// the y-axis pixel position of the mouse during the click event
275
ADOBE ATMOSPHERE
User Guide

Advertisement

Table of Contents
loading

Table of Contents