-
public interface MultiTouchController.MultiTouchObjectCanvas<T>
-
-
Method Summary
Modifier and Type Method Description abstract TgetDraggableObjectAtPoint(MultiTouchController.PointInfo touchPoint)See if there is a draggable object at the current point. abstract voidgetPositionAndScale(T obj, MultiTouchController.PositionAndScale objPosAndScaleOut)Get the screen coords of the dragged object's origin, and scale multiplier to convert screen coords to obj coords. abstract booleansetPositionAndScale(T obj, MultiTouchController.PositionAndScale newObjPosAndScale, MultiTouchController.PointInfo touchPoint)Callback to update the position and scale (in object coords) of the currently-dragged object. abstract voidselectObject(T obj, MultiTouchController.PointInfo touchPoint)Select an object at the given point. -
-
Method Detail
-
getDraggableObjectAtPoint
abstract T getDraggableObjectAtPoint(MultiTouchController.PointInfo touchPoint)
See if there is a draggable object at the current point. Returns the object at the point, or null if nothing to drag. To start a multitouchdrag/stretch operation, this routine must return some non-null reference to an object. This object is passed into the other methods in thisinterface when they are called.
- Parameters:
touchPoint- The point being tested (in object coordinates).
-
getPositionAndScale
abstract void getPositionAndScale(T obj, MultiTouchController.PositionAndScale objPosAndScaleOut)
Get the screen coords of the dragged object's origin, and scale multiplier to convert screen coords to obj coords. The job of this routineis to call the .set() method on the passed PositionAndScale object to record the initial position and scale of the object (in objectcoordinates) before any dragging/stretching takes place.
- Parameters:
obj- The object being dragged/stretched.objPosAndScaleOut- Output parameter: You need to call objPosAndScaleOut.set() to record the current position and scale of obj.
-
setPositionAndScale
abstract boolean setPositionAndScale(T obj, MultiTouchController.PositionAndScale newObjPosAndScale, MultiTouchController.PointInfo touchPoint)
Callback to update the position and scale (in object coords) of the currently-dragged object.
- Parameters:
obj- The object being dragged/stretched.newObjPosAndScale- The new position and scale of the object, in object coordinates.touchPoint- Info about the current touch point, including multitouch information and utilities to calculate and cache multitouch pinchdiameter etc.
-
selectObject
abstract void selectObject(T obj, MultiTouchController.PointInfo touchPoint)
Select an object at the given point. Can be used to bring the object to top etc. Only called when first touchpoint goes down, not whenmultitouch is initiated. Also called with null on touch-up.
- Parameters:
obj- The object being selected by single-touch, or null on touch-up.touchPoint- The current touch point.
-
-
-
-