Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Another CCARRAY_FOREACH replacement. I missed one.

  • Loading branch information...
commit 7ab3dfd735ae4169aa2436403aa6cffa4f568569 1 parent 5b856fc
Jerrod Putman authored
Showing with 17 additions and 1 deletion.
  1. +14 −0 CCKit/CCGestureRecognizer.h
  2. +3 −1 CCKit/CCGestureRecognizer.m
View
14 CCKit/CCGestureRecognizer.h
@@ -60,10 +60,24 @@
// Additions to CCNode to allow better integration with gesture recognizers.
@interface CCNode (GestureRecognizerAdditions)
+#pragma mark - Managing gesture recognizers
+
+// The CCGestureRecognizers currently attached to this node.
+@property (nonatomic, readonly) NSArray *gestureRecognizers;
+
+// Adds a CCGestureRecognizer to this node.
- (void)addGestureRecognizer:(CCGestureRecognizer *)gestureRecognizer;
+
+// Removes a CCGestureRecognizer to this node.
- (void)removeGestureRecognizer:(CCGestureRecognizer *)gestureRecognizer;
+
+#pragma mark - Utility methods
+
+// Utility method to determine if a touch point is within the bounds of the node.
- (BOOL)isPointInArea:(CGPoint)pt;
+
+// Utility method to determine if a node in a node tree is touched.
- (BOOL)isNodeInTreeTouched:(CGPoint)pt;
@end
View
4 CCKit/CCGestureRecognizer.m
@@ -184,6 +184,7 @@ - (void)dealloc
#pragma mark -
+
static const NSString *CCNodeGestureRecognizerAdditionsKey = @"CCNodeGestureRecognizerAdditionsKey";
@@ -245,7 +246,8 @@ - (BOOL)isNodeInTreeTouched:(CGPoint)pt
return YES;
BOOL rslt = NO;
- for(CCNode *child in [children_ getNSArray])
+ CCNode *child;
+ CCARRAY_FOREACH(children_, child)
{
if([child isNodeInTreeTouched:pt])
{
Please sign in to comment.
Something went wrong with that request. Please try again.