-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCCMask.h
38 lines (29 loc) · 948 Bytes
/
CCMask.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
// CCMask.h
// Masking
//
// Created by Gilles Lesire on 22/04/11.
// GNU General Public License (GPL)
// https://github.com/KingIsulgard/Cocos2D-CCMask-class
#import "cocos2d.h"
@interface CCMask : CCSprite {
// Some screen information
CGSize size;
CGPoint screenMid;
// The given sprites
CCSprite *maskSprite;
CCSprite *objectSprite;
// RenderTextures use for masking
CCRenderTexture *maskNegative;
CCRenderTexture *masked;
}
// Initialize a masked object based on an object sprite and a mask sprite
+ (id) createMaskForObject: (CCSprite *) object withMask: (CCSprite *) mask;
// Redraw the masked image
- (void) redrawMasked;
// When dynamic masking is active, you have the ability to change the masked object or the mask itself
- (void) setObject: (CCSprite *) object;
- (void) setMask: (CCSprite *) mask;
// Return the masked object as a sprite
- (CCSprite *) getMaskedSprite;
@end