ScriptX Tracking Service

By Don Hopkins, Kaleida Labs


This is the documentation for the ScriptX Tracking Service. The Tracking Service is a set of classes for tracking mouse clicks and movements. It includes the TrackService class, a controller that manages interests and handles low level input events, and the Tracker class, a mixin that participates in the high level tracking protocol with the tracking service. It also provides the CachedPresenter class, that draws an offscreen group of presenters into a bitmap cache, which dramatically improves compositor performance.

This tracking service offers several advantages over the lower level DragController built into ScriptX. It's designed to be very easy to use, so many of the common types of mouse tracking can be coded with a minimum effort. It has some fancy features, but it provides sensible defaults and a clean interface so it's not complicated, and the features don't get in your way if you don't need them.

Some of its important features include delegation of tracking to objects other than the one originally clicked on, and transformation of event coordinates through an arbitrary TwoDMatrix. These features made it easy to implement a cached offscreen group, that draws quickly from a bitmap cache, but passes tracking through to offscreen presenters. (That was not easy to do with the DragController, since it provides no way to track input events on offscreen presenters.)

The Tracking Service is used by the DreamScape demo.

Index of classes: Tracker, TrackerMulti, TrackerMultiPresenter, TrackerGroupPresenter, TrackerTwoDSpace, CachedPresenter, TrackerCachedPresenter, TrackService.