/Classes/TouchableNode.h
C Header | 37 lines | 16 code | 6 blank | 15 comment | 0 complexity | 5941a6109db3391da13db0ce93998e9b MD5 | raw file
Possible License(s): Apache-2.0
1// 2// TouchableNode.h 3// 4// Created by Karl Stenerud on 10-01-21. 5// 6 7#import "cocos2d.h" 8 9/** 10 * A node that can respond to touches. 11 * This code was extracted from CCLayer. 12 */ 13@interface TouchableNode : CCNode <CCStandardTouchDelegate, CCTargetedTouchDelegate> 14{ 15 BOOL isTouchEnabled; 16 int touchPriority; 17 BOOL targetedTouches; 18 BOOL swallowTouches; 19 BOOL registeredWithDispatcher; 20} 21/** Priority position in which this node will be handled (lower = sooner) */ 22@property(nonatomic,readwrite,assign) int touchPriority; 23 24@property(nonatomic,readwrite,assign) BOOL targetedTouches; 25@property(nonatomic,readwrite,assign) BOOL swallowTouches; 26 27/** whether or not it will receive Touch events. 28 You can enable / disable touch events with this property. 29 Only the touches of this node will be affected. This "method" is not propagated to it's children. 30 @since v0.8.1 31 */ 32@property(nonatomic,assign) BOOL isTouchEnabled; 33 34- (BOOL) touchHitsSelf:(UITouch*) touch; 35- (BOOL) touch:(UITouch*) touch hitsNode:(CCNode*) node; 36 37@end