Skip to content

Commit

Permalink
More interesting CCSpriteMultiTouchTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Birkemose committed Jul 31, 2014
1 parent e13980d commit be9a5c3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
Binary file not shown.
31 changes: 18 additions & 13 deletions cocos2d-iphone-ext/Classes/Tests/CCSpriteMultiTouchTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,24 @@ - (void)multiTouchTest

[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"cards.classic.plist"];

// load a multi touch sprite
CCSpriteMultiTouch *card = [CCSpriteMultiTouch spriteWithImageNamed:[cardNode randomCardName]];
card.position = ccp([CCDirector sharedDirector].viewSize.width * 0.5, [CCDirector sharedDirector].viewSize.height * 0.5);
card.scale = 2.5;
[self.contentNode addChild:card];

// enable dragging, scaling etc
card.touchCountForDrag = 2; // zwei fingers to drag
card.touchCountForRotate = 2; // dos fingers to rotate
card.touchCountForScale = 2; // two fingers to scale

card.userInteractionEnabled = YES;
card.multipleTouchEnabled = YES;
for (int index = 1; index <= 3; index ++)
{
// load a multi touch sprite
CCSpriteMultiTouch *card = [CCSpriteMultiTouch spriteWithImageNamed:[cardNode randomCardName]];
card.position = ccp(
[CCDirector sharedDirector].viewSize.width * 0.25 * index,
[CCDirector sharedDirector].viewSize.height * 0.5);
card.scale = 2.5;
[self.contentNode addChild:card];

// enable dragging, scaling etc
card.touchCountForDrag = 2; // zwei fingers to drag
card.touchCountForRotate = 2; // dos fingers to rotate
card.touchCountForScale = 2; // two fingers to scale

card.userInteractionEnabled = YES;
card.multipleTouchEnabled = YES;
}
}

//----------------------------------------------------------------------
Expand Down

0 comments on commit be9a5c3

Please sign in to comment.