KKTouch Class Reference
| Inherits from | NSObject |
| Declared in | KKTouch.h |
Overview
The Kobold2D equivalent of the UITouch class contains the same information as a UITouch. The locations are already converted to the Cocos2D view coordinate space, you should not call convertToGL on the KKTouch locations. Touches are pooled to avoid frequent alloc/dealloc cycles as fingers touch the screen and are lifted back up again.
The touchID property is a unique identifier for a particular finger that touches the screen. The touchID is simply the UITouch pointer cast to NSUInteger, so you can get to the UITouch if needed by casting touchID to UITouch: UITouch uiTouch = (UITouch*)(kkTouch.touchID);
Tasks
-
touchIDAn identifier that uniquely identifies one particular finger while it is touching. Used to track fingers over several frames.
property -
locationThe current location of the touch, already converted to Cocos2D view coordinates and device orientation.
property -
previousLocationThe previous (frame’s) location of the touch, already converted to Cocos2D view coordinates and device orientation.
property -
tapCountHow often the finger was tapped for this touch.
property -
timestampThe timestamp when the UITouch was last updated.
property -
phaseThe KKTouchPhase the touch is currently in.
property -
– setTouchWithLocation:previousLocation:tapCount:timestamp:phase: -
– invalidate -
– setValidWithID: -
– setTouchPhase:
Properties
location
The current location of the touch, already converted to Cocos2D view coordinates and device orientation.
@property (nonatomic, readonly) CGPoint locationDeclared In
KKTouch.hphase
The KKTouchPhase the touch is currently in.
@property (nonatomic, readonly) KKTouchPhase phaseDeclared In
KKTouch.hpreviousLocation
The previous (frame’s) location of the touch, already converted to Cocos2D view coordinates and device orientation.
@property (nonatomic, readonly) CGPoint previousLocationDeclared In
KKTouch.htapCount
How often the finger was tapped for this touch.
@property (nonatomic, readonly) NSUInteger tapCountDeclared In
KKTouch.h