/Classes/TouchableNode.h

http://github.com/kstenerud/ObjectAL-for-iPhone · C Header · 37 lines · 16 code · 6 blank · 15 comment · 0 complexity · 5941a6109db3391da13db0ce93998e9b MD5 · raw file

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