-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathREADME
More file actions
21 lines (13 loc) · 693 Bytes
/
README
File metadata and controls
21 lines (13 loc) · 693 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
CCMaskTo
============
CCMaskTo is a CCIntervalAction for cocos2d-iphone written by georgejcook and slightly modified by taberrr to work with cocos2d v0.99.3-rc.
http://www.cocos2d-iphone.org/forum/topic/1306#post-7891
Usage:
//
// Reveal the sprite in a "swipe from left" style mask transition
//
CCSprite *mySprite = [CCSprite spriteWithTexture: spriteSheet.texture rect: CGRectMake(0,0, 1,10)];
[spriteSheet addChild: mySprite];
mySprite.position = ccp(screenSize.width / 2 - 45, screenSize.height / 2);
[mySprite runAction: [CCMoveBy actionWithDuration: 1 position: ccp(45, 0)]];
[mySprite runAction: [CCMaskTo actionWithDuration: 1 rect: CGRectMake(0,0, 90,10)];