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

Properties

location

The current location of the touch, already converted to Cocos2D view coordinates and device orientation.

@property (nonatomic, readonly) CGPoint location

Declared In

KKTouch.h

phase

The KKTouchPhase the touch is currently in.

@property (nonatomic, readonly) KKTouchPhase phase

Declared In

KKTouch.h

previousLocation

The previous (frame’s) location of the touch, already converted to Cocos2D view coordinates and device orientation.

@property (nonatomic, readonly) CGPoint previousLocation

Declared In

KKTouch.h

tapCount

How often the finger was tapped for this touch.

@property (nonatomic, readonly) NSUInteger tapCount

Declared In

KKTouch.h

timestamp

The timestamp when the UITouch was last updated.

@property (nonatomic, readonly) NSTimeInterval timestamp

Declared In

KKTouch.h

touchID

An identifier that uniquely identifies one particular finger while it is touching. Used to track fingers over several frames.

@property (nonatomic, readonly) NSUInteger touchID

Declared In

KKTouch.h

Instance Methods

invalidate

setTouchPhase:

setTouchWithLocation:previousLocation:tapCount:timestamp:phase:

setValidWithID: