标签:
Inherits from | NSObject |
Declared in | CCTouch.h |
Thin wrapper around platform-specific touch events (ie UITouch). CCTouch is platform independent version of the touch event objects sent by iOS, Android and OS X.
CCtouch是与平台无关的touch事件。
Note: You should never create instances of CCTouch.
你永远也不应该创建一个CCTouch实例。
The CCTouchPhase this touch is currently in.
这个触摸目前的阶段
@property (nonatomic, readonly) CCTouchPhase phase
v3.2 and later
CCTouch.h
The number of taps for this touch event.
触摸事件的敲击次数。
@property (nonatomic, readonly) NSUInteger tapCount
v3.2 and later
CCTouch.h
The timestamp of the most recent touch phase change.
最近的触摸阶段改变的时间戳。
@property (nonatomic, readonly) NSTimeInterval timestamp
v3.2 and later
CCTouch.h
The associated platform-specific touch event (ie UITouch). PlatformTouch is equivalent to UITouch on iOS, CCTouchAndroid on Android and NSObject on OS X.
@property (nonatomic, strong) PlatformTouch *uiTouch
v3.2 and later
Note: The CCTouchAndroid class is not documented, it is just a subset of CCTouch.
CCTouch.h
The node to which this touch should be relative to.
这个触摸事件应该关联的node。
- (CGPoint)locationInNode:(CCNode *)node
The node to which this touch should be relative to.
The touch location relative to the given node’s position.
v3.2 and later
CCTouch.h
The view to which this touch should be relative to.
- (CGPoint)locationInView:(CCGLView *)view
The view to which this touch should be relative to.
The touch location relative to the given view.
v3.2 and later
CCTouch.h
The touch location relative to the scene (aka “world”).
相对于scene的触摸位置.
- (CGPoint)locationInWorld
The touch location relative to the scene (aka “world”).
v3.2 and later
CCTouch.h
The view to which this touch should be relative to.
- (CGPoint)previousLocationInView:(CCGLView *)view
The view to which this touch should be relative to.
v3.2 and later
CCTouch.h
Declared in | CCTouch.h |
Touch phases, equivalent to UITouch phases. Used by touch events received through CCResponder.
触摸阶段,等同于UITouch phases。
typedef NS_ENUM(NSInteger, CCTouchPhase ) {
CCTouchPhaseBegan,
CCTouchPhaseMoved,
CCTouchPhaseStationary,
CCTouchPhaseEnded,
CCTouchPhaseCancelled,
};
CCTouchPhaseBegan
A finger just touched the screen.
手指刚刚接触屏幕
Declared In CCTouch.h
.
CCTouchPhaseMoved
A finger on the screen just moved.
手指刚刚离开屏幕
Declared In CCTouch.h
.
CCTouchPhaseStationary
A finger touches the screen but hasn’t moved recently.
一个手指触摸到屏幕但是还没有离开
Declared In CCTouch.h
.
CCTouchPhaseEnded
A finger was lifted from the screen.
一个手指脱离了屏幕
Declared In CCTouch.h
.
CCTouchPhaseCancelled
The system cancelled touch events. This can have many reasons, for instance when receiving a call and the screen goes black or a gesture recognizer cancelling touch events.
系统取消了触摸事件。这可能由多种原因造成,比如当接到电话,屏幕变黑,或者手势识别取消了触摸事件等。
Declared In CCTouch.h
.
CCTouch.h
CCTouch和CCTouchPhase --- Cocos2D-Swift v3.3
标签:
原文地址:http://www.cnblogs.com/somebod-Y/p/4264329.html