@@ -24,53 +24,55 @@ -(void)setupPaddingEffectTest
24
24
{
25
25
self.subTitle = @" Effect Padding Test" ;
26
26
27
- CCSprite *original = [CCSprite spriteWithImageNamed: @" Images/WhiteDiamond .png" ];
27
+ CCSprite *original = [CCSprite spriteWithImageNamed: @" Images/particles .png" ];
28
28
original.positionType = CCPositionTypeNormalized;
29
- original.position = ccp (0.25 , 0.5 );
29
+ original.position = ccp (0.75 , 0.75 );
30
30
31
31
[self .contentNode addChild: original];
32
32
33
33
CCLabelTTF *title1 = [CCLabelTTF labelWithString: @" Original Sprite" fontName: @" HelveticaNeue-Light" fontSize: 14 * [CCDirector sharedDirector ].UIScaleFactor];
34
34
title1.color = [CCColor whiteColor ];
35
35
title1.positionType = CCPositionTypeNormalized;
36
- title1.position = ccp (0 .25f , 0 .1f );
36
+ title1.position = ccp (0 .25f , 0 .75f );
37
37
title1.horizontalAlignment = CCTextAlignmentCenter;
38
38
39
39
[self .contentNode addChild: title1];
40
40
41
41
42
- CCSprite *blurred = [CCSprite spriteWithImageNamed: @" Images/WhiteDiamond.png" ];
43
- blurred.positionType = CCPositionTypeNormalized;
44
- blurred.position = ccp (0.5 , 0.5 );
42
+ \
43
+ CCSprite *affected = [CCSprite spriteWithImageNamed: @" Images/particles.png" ];
44
+ affected.positionType = CCPositionTypeNormalized;
45
+ affected.position = ccp (0.75 , 0.5 );
45
46
46
- CCEffect *blur1 = [CCEffectBlur effectWithBlurRadius: 4 .0f ];
47
- blurred .effect = blur1 ;
47
+ CCEffectColorChannelOffset *offset1 = [CCEffectColorChannelOffset effectWithRedOffset: GLKVector2Make ( 5 . 0f , 0 . 0f ) greenOffset: GLKVector2Make (- 4 .0f , 4 . 0f ) blueOffset: GLKVector2Make (- 4 . 0f , - 4 . 0f ) ];
48
+ affected .effect = offset1 ;
48
49
49
- [self .contentNode addChild: blurred ];
50
+ [self .contentNode addChild: affected ];
50
51
51
- CCLabelTTF *title2 = [CCLabelTTF labelWithString: @" Blur (no padding)" fontName: @" HelveticaNeue-Light" fontSize: 14 * [CCDirector sharedDirector ].UIScaleFactor];
52
+ CCLabelTTF *title2 = [CCLabelTTF labelWithString: @" Color channel offset (no padding)" fontName: @" HelveticaNeue-Light" fontSize: 14 * [CCDirector sharedDirector ].UIScaleFactor];
52
53
title2.color = [CCColor whiteColor ];
53
54
title2.positionType = CCPositionTypeNormalized;
54
- title2.position = ccp (0 .5f , 0 .1f );
55
+ title2.position = ccp (0 .25f , 0 .5f );
55
56
title2.horizontalAlignment = CCTextAlignmentCenter;
56
57
57
58
[self .contentNode addChild: title2];
58
59
59
60
60
- CCSprite *padded = [CCSprite spriteWithImageNamed: @" Images/WhiteDiamond.png" ];
61
+
62
+ CCSprite *padded = [CCSprite spriteWithImageNamed: @" Images/particles.png" ];
61
63
padded.positionType = CCPositionTypeNormalized;
62
- padded.position = ccp (0.75 , 0.5 );
64
+ padded.position = ccp (0.75 , 0.25 );
63
65
64
- CCEffect *blur2 = [CCEffectBlur effectWithBlurRadius: 4 .0f ];
65
- blur2 .padding = CGSizeMake (20 .0f , 20 .0f );
66
- padded.effect = blur2 ;
66
+ CCEffectColorChannelOffset *offset2 = [CCEffectColorChannelOffset effectWithRedOffset: GLKVector2Make ( 5 . 0f , 0 . 0f ) greenOffset: GLKVector2Make (- 4 .0f , 4 . 0f ) blueOffset: GLKVector2Make (- 4 . 0f , - 4 . 0f ) ];
67
+ offset2 .padding = CGSizeMake (5 .0f , 5 .0f );
68
+ padded.effect = offset2 ;
67
69
68
70
[self .contentNode addChild: padded];
69
71
70
- CCLabelTTF *title3 = [CCLabelTTF labelWithString: @" Padded Blur " fontName: @" HelveticaNeue-Light" fontSize: 14 * [CCDirector sharedDirector ].UIScaleFactor];
72
+ CCLabelTTF *title3 = [CCLabelTTF labelWithString: @" Color channel offset (with padding) " fontName: @" HelveticaNeue-Light" fontSize: 14 * [CCDirector sharedDirector ].UIScaleFactor];
71
73
title3.color = [CCColor whiteColor ];
72
74
title3.positionType = CCPositionTypeNormalized;
73
- title3.position = ccp (0 .75f , 0 .1f );
75
+ title3.position = ccp (0 .25f , 0 .25f );
74
76
title3.horizontalAlignment = CCTextAlignmentCenter;
75
77
76
78
[self .contentNode addChild: title3];
0 commit comments