Skip to content

Commit 072f1b8

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into develop
Conflicts: .gitmodules
2 parents 56908e7 + c5a9fd7 commit 072f1b8

31 files changed

+858
-185
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[submodule "external/Chipmunk"]
22
path = external/Chipmunk
3-
url=https://github.com/slembcke/Chipmunk2D.git
3+
url=https://github.com/slembcke/Chipmunk2D.git
44
[submodule "external/ObjectAL"]
55
path = external/ObjectAL
66
url = https://github.com/spritebuilder/ObjectAL-for-Cocos2D.git

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.3.0-alpha.1
1+
3.3.0-alpha.1

cocos2d-ios.xcodeproj/project.pbxproj

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@
118118
9D85671E191B018200573093 /* CCEffectBrightness.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D85671C191B018200573093 /* CCEffectBrightness.m */; };
119119
9D856721191B019900573093 /* CCEffectContrast.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D85671F191B019900573093 /* CCEffectContrast.h */; };
120120
9D856722191B019900573093 /* CCEffectContrast.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D856720191B019900573093 /* CCEffectContrast.m */; };
121+
9DBCA31419B68BE400EFE96D /* CCEffectColorChannelOffset.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DBCA31219B68BE400EFE96D /* CCEffectColorChannelOffset.h */; };
122+
9DBCA31519B68BE400EFE96D /* CCEffectColorChannelOffset.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DBCA31319B68BE400EFE96D /* CCEffectColorChannelOffset.m */; };
121123
9DF37621191C594A00C6D27A /* CCEffectPixellate.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF3761F191C594A00C6D27A /* CCEffectPixellate.h */; };
122124
9DF37622191C594A00C6D27A /* CCEffectPixellate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF37620191C594A00C6D27A /* CCEffectPixellate.m */; };
123125
A003AC8C1657071100C7B792 /* ccFPSImages.h in Headers */ = {isa = PBXBuildFile; fileRef = A003AC8B1657071100C7B792 /* ccFPSImages.h */; };
@@ -765,7 +767,7 @@
765767
5BC3CB5219626E4F00C4F0D0 /* CCGestureListener.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = CCGestureListener.java; sourceTree = "<group>"; };
766768
5BC3CB5719626FA000C4F0D0 /* CCGestureListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCGestureListener.h; path = Android/CCGestureListener.h; sourceTree = "<group>"; };
767769
5BC3CB5819626FA000C4F0D0 /* CCGestureListener.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CCGestureListener.m; path = Android/CCGestureListener.m; sourceTree = "<group>"; };
768-
5BF3267A195F8D8800D9A51A /* cocos2dJava.jar */ = {isa = PBXFileReference; explicitFileType = compiled.java.jar; includeInIndex = 0; path = cocos2dJava.jar; sourceTree = BUILT_PRODUCTS_DIR; };
770+
5BF3267A195F8D8800D9A51A /* cocos2dJava.jar */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = archive.jar; path = cocos2dJava.jar; sourceTree = BUILT_PRODUCTS_DIR; };
769771
5BF3268C195F8E0300D9A51A /* CCActivity.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = CCActivity.java; sourceTree = "<group>"; };
770772
5BF3268D195F8E0300D9A51A /* CCGLView.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = CCGLView.java; sourceTree = "<group>"; };
771773
5BF32696195F947800D9A51A /* CCActivity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCActivity.h; path = Android/CCActivity.h; sourceTree = "<group>"; };
@@ -776,6 +778,8 @@
776778
9D85671C191B018200573093 /* CCEffectBrightness.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCEffectBrightness.m; sourceTree = "<group>"; };
777779
9D85671F191B019900573093 /* CCEffectContrast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEffectContrast.h; sourceTree = "<group>"; };
778780
9D856720191B019900573093 /* CCEffectContrast.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCEffectContrast.m; sourceTree = "<group>"; };
781+
9DBCA31219B68BE400EFE96D /* CCEffectColorChannelOffset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEffectColorChannelOffset.h; sourceTree = "<group>"; };
782+
9DBCA31319B68BE400EFE96D /* CCEffectColorChannelOffset.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCEffectColorChannelOffset.m; sourceTree = "<group>"; };
779783
9DF3761F191C594A00C6D27A /* CCEffectPixellate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEffectPixellate.h; sourceTree = "<group>"; };
780784
9DF37620191C594A00C6D27A /* CCEffectPixellate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCEffectPixellate.m; sourceTree = "<group>"; };
781785
A003AC8B1657071100C7B792 /* ccFPSImages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccFPSImages.h; sourceTree = "<group>"; };
@@ -1540,6 +1544,8 @@
15401544
isa = PBXGroup;
15411545
children = (
15421546
D27451BF19AFC44D006DA0A1 /* DistanceField */,
1547+
9DBCA31219B68BE400EFE96D /* CCEffectColorChannelOffset.h */,
1548+
9DBCA31319B68BE400EFE96D /* CCEffectColorChannelOffset.m */,
15431549
D3903B081995285B003AA81A /* CCEffectBlur.h */,
15441550
D3903B091995285B003AA81A /* CCEffectBlur.m */,
15451551
D268FE151980791300ECBCD0 /* CCEffectRefraction.h */,
@@ -1718,6 +1724,7 @@
17181724
B7D273111822F4AA0054849B /* CCBLocalizationManager.h in Headers */,
17191725
5018F2690DFDEAFF00C013A5 /* CCAction.h in Headers */,
17201726
5018F26B0DFDEAFF00C013A5 /* CCNode.h in Headers */,
1727+
9DBCA31419B68BE400EFE96D /* CCEffectColorChannelOffset.h in Headers */,
17211728
5018F26D0DFDEAFF00C013A5 /* CCDirector.h in Headers */,
17221729
5018F26F0DFDEAFF00C013A5 /* CCActionInstant.h in Headers */,
17231730
5018F2710DFDEAFF00C013A5 /* CCActionInterval.h in Headers */,
@@ -2225,6 +2232,7 @@
22252232
50CB3B0F100AC43A00B7A750 /* CCActionManager.m in Sources */,
22262233
D3903B11199528A0003AA81A /* CCRenderDispatch.m in Sources */,
22272234
B7E775D118527EF0004221AA /* CCAppDelegate.m in Sources */,
2235+
9DBCA31519B68BE400EFE96D /* CCEffectColorChannelOffset.m in Sources */,
22282236
D3903B15199528B6003AA81A /* CCMetalView.m in Sources */,
22292237
B7D273141822F4AA0054849B /* CCBReader.m in Sources */,
22302238
50F29F5610204FD60046CA73 /* base64.c in Sources */,

cocos2d-osx.xcodeproj/project.pbxproj

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
926B97E519385F8A00E345FB /* CCAnimationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 926B97E019385F8A00E345FB /* CCAnimationManager.h */; };
1919
926B97EA1938602200E345FB /* CCAnimationManager+FrameAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 926B97E81938602200E345FB /* CCAnimationManager+FrameAnimation.m */; };
2020
926B97EB1938602200E345FB /* CCAnimationManager+FrameAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 926B97E91938602200E345FB /* CCAnimationManager+FrameAnimation.h */; };
21+
9D9E341519B7AAB800ADD7CB /* CCEffectColorChannelOffset.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D9E340F19B7AAB800ADD7CB /* CCEffectColorChannelOffset.h */; };
22+
9D9E341619B7AAB800ADD7CB /* CCEffectColorChannelOffset.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D9E341019B7AAB800ADD7CB /* CCEffectColorChannelOffset.m */; };
23+
9D9E341719B7AAB800ADD7CB /* CCEffectDropShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D9E341119B7AAB800ADD7CB /* CCEffectDropShadow.h */; };
24+
9D9E341819B7AAB800ADD7CB /* CCEffectDropShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D9E341219B7AAB800ADD7CB /* CCEffectDropShadow.m */; };
25+
9D9E341919B7AAB800ADD7CB /* CCEffectOuterGlow.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D9E341319B7AAB800ADD7CB /* CCEffectOuterGlow.h */; };
26+
9D9E341A19B7AAB800ADD7CB /* CCEffectOuterGlow.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D9E341419B7AAB800ADD7CB /* CCEffectOuterGlow.m */; };
2127
A003ACA7165731D500C7B792 /* ccFPSImages.h in Headers */ = {isa = PBXBuildFile; fileRef = A003ACA5165731D500C7B792 /* ccFPSImages.h */; };
2228
A003ACA8165731D500C7B792 /* ccFPSImages.m in Sources */ = {isa = PBXBuildFile; fileRef = A003ACA6165731D500C7B792 /* ccFPSImages.m */; };
2329
A03714D7154F1D9300081CBA /* CCNode+Debug.h in Headers */ = {isa = PBXBuildFile; fileRef = A03714D5154F1D9300081CBA /* CCNode+Debug.h */; };
@@ -371,6 +377,12 @@
371377
926B97E019385F8A00E345FB /* CCAnimationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCAnimationManager.h; path = "cocos2d-ui/CCBReader/CCAnimationManager.h"; sourceTree = "<group>"; };
372378
926B97E81938602200E345FB /* CCAnimationManager+FrameAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "CCAnimationManager+FrameAnimation.m"; path = "cocos2d-ui/CCBReader/CCAnimationManager+FrameAnimation.m"; sourceTree = "<group>"; };
373379
926B97E91938602200E345FB /* CCAnimationManager+FrameAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "CCAnimationManager+FrameAnimation.h"; path = "cocos2d-ui/CCBReader/CCAnimationManager+FrameAnimation.h"; sourceTree = "<group>"; };
380+
9D9E340F19B7AAB800ADD7CB /* CCEffectColorChannelOffset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEffectColorChannelOffset.h; sourceTree = "<group>"; };
381+
9D9E341019B7AAB800ADD7CB /* CCEffectColorChannelOffset.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCEffectColorChannelOffset.m; sourceTree = "<group>"; };
382+
9D9E341119B7AAB800ADD7CB /* CCEffectDropShadow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEffectDropShadow.h; sourceTree = "<group>"; };
383+
9D9E341219B7AAB800ADD7CB /* CCEffectDropShadow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCEffectDropShadow.m; sourceTree = "<group>"; };
384+
9D9E341319B7AAB800ADD7CB /* CCEffectOuterGlow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEffectOuterGlow.h; sourceTree = "<group>"; };
385+
9D9E341419B7AAB800ADD7CB /* CCEffectOuterGlow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCEffectOuterGlow.m; sourceTree = "<group>"; };
374386
A003ACA5165731D500C7B792 /* ccFPSImages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccFPSImages.h; sourceTree = "<group>"; };
375387
A003ACA6165731D500C7B792 /* ccFPSImages.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ccFPSImages.m; sourceTree = "<group>"; };
376388
A0191EAA167FDBA40099349A /* libc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.dylib"; path = "usr/lib/libc++.dylib"; sourceTree = SDKROOT; };
@@ -935,6 +947,8 @@
935947
D3DBE16C19C8DED80009E45F /* CCEffectDistanceField.m */,
936948
D3DBE16F19C8DED80009E45F /* CCEffectDropShadow.h */,
937949
D3DBE17019C8DED80009E45F /* CCEffectDropShadow.m */,
950+
9D9E340F19B7AAB800ADD7CB /* CCEffectColorChannelOffset.h */,
951+
9D9E341019B7AAB800ADD7CB /* CCEffectColorChannelOffset.m */,
938952
D3903B01199527AA003AA81A /* CCEffectBlur.h */,
939953
D3903B02199527AA003AA81A /* CCEffectBlur.m */,
940954
D2D598421987132700BDAF25 /* CCEffect_Private.h */,
@@ -1489,6 +1503,7 @@
14891503
E076E75C1225EC7400DE0DA2 /* base64.h in Headers */,
14901504
B7D273311822F5460054849B /* CCBSequence.h in Headers */,
14911505
E076E7601225EC7400DE0DA2 /* CCFileUtils.h in Headers */,
1506+
9D9E341519B7AAB800ADD7CB /* CCEffectColorChannelOffset.h in Headers */,
14921507
E076E7621225EC7400DE0DA2 /* CCProfiling.h in Headers */,
14931508
E076E7651225EC7400DE0DA2 /* ccUtils.h in Headers */,
14941509
D2D598801987132700BDAF25 /* CCEffectStack_Private.h in Headers */,
@@ -1785,6 +1800,7 @@
17851800
A046E2B514C1E5000005BBF2 /* CCES2Renderer.m in Sources */,
17861801
A046E2B814C1E5000005BBF2 /* CCGLView.m in Sources */,
17871802
D389412918639DD400725CFC /* CCPhysicsJoint.m in Sources */,
1803+
9D9E341619B7AAB800ADD7CB /* CCEffectColorChannelOffset.m in Sources */,
17881804
A0C879AD14F98F1C00C0E8B2 /* NSThread+performBlock.m in Sources */,
17891805
571CD04119649E22003D460C /* CCPlatformTextFieldMac.m in Sources */,
17901806
D2D5986A1987132700BDAF25 /* CCEffectBrightness.m in Sources */,

cocos2d-ui-tests/tests/CCBMFontTest.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
static NSString *TEST_STRINGS[] = {
1313
@"ABCDEFGHIJKLM\nNOPQRSTUVWXYZ",
1414
@"abcdefghijklm\nnopqrstuvwxyz",
15+
@"first line\u2028second line",
1516
@",.?!;:'\"",
1617
@"()[]{}<>\\|/\n",
1718
@"@#$%^&*+-=_",

cocos2d-ui-tests/tests/CCEffectsTest.m

Lines changed: 148 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,151 @@ - (void)enableOutline:(id)sender
251251

252252
#endif
253253

254+
-(void)setupPaddingEffectTest
255+
{
256+
self.subTitle = @"Effect Padding Test";
257+
258+
{
259+
CCSprite *sprite = [CCSprite spriteWithImageNamed:@"Images/particles.png"];
260+
sprite.positionType = CCPositionTypeNormalized;
261+
sprite.position = ccp(0.75f, 0.8f);
262+
263+
[self.contentNode addChild:sprite];
264+
265+
CCLabelTTF *title = [CCLabelTTF labelWithString:@"Original Sprite" fontName:@"HelveticaNeue-Light" fontSize:14 * [CCDirector sharedDirector].UIScaleFactor];
266+
title.color = [CCColor whiteColor];
267+
title.positionType = CCPositionTypeNormalized;
268+
title.position = ccp(0.25f, 0.8f);
269+
title.horizontalAlignment = CCTextAlignmentCenter;
270+
271+
[self.contentNode addChild:title];
272+
}
273+
274+
{
275+
CCSprite *sprite = [CCSprite spriteWithImageNamed:@"Images/particles.png"];
276+
sprite.positionType = CCPositionTypeNormalized;
277+
sprite.position = ccp(0.75f, 0.65f);
278+
279+
CCEffectColorChannelOffset *offset = [CCEffectColorChannelOffset effectWithRedOffset:GLKVector2Make(5.0f, 0.0f) greenOffset:GLKVector2Make(-4.0f, 4.0f) blueOffset:GLKVector2Make(-4.0f, -4.0f)];
280+
sprite.effect = offset;
281+
282+
[self.contentNode addChild:sprite];
283+
284+
CCLabelTTF *title = [CCLabelTTF labelWithString:@"Color channel offset without padding" fontName:@"HelveticaNeue-Light" fontSize:14 * [CCDirector sharedDirector].UIScaleFactor];
285+
title.color = [CCColor whiteColor];
286+
title.positionType = CCPositionTypeNormalized;
287+
title.position = ccp(0.25f, 0.65f);
288+
title.horizontalAlignment = CCTextAlignmentCenter;
289+
290+
[self.contentNode addChild:title];
291+
}
292+
293+
{
294+
CCSprite *sprite = [CCSprite spriteWithImageNamed:@"Images/particles.png"];
295+
sprite.positionType = CCPositionTypeNormalized;
296+
sprite.position = ccp(0.75f, 0.5f);
297+
298+
CCEffectColorChannelOffset *offset = [CCEffectColorChannelOffset effectWithRedOffset:GLKVector2Make(5.0f, 0.0f) greenOffset:GLKVector2Make(-4.0f, 4.0f) blueOffset:GLKVector2Make(-4.0f, -4.0f)];
299+
offset.padding = CGSizeMake(5.0f, 5.0f);
300+
sprite.effect = offset;
301+
302+
[self.contentNode addChild:sprite];
303+
304+
CCLabelTTF *title = [CCLabelTTF labelWithString:@"Color channel offset with padding" fontName:@"HelveticaNeue-Light" fontSize:14 * [CCDirector sharedDirector].UIScaleFactor];
305+
title.color = [CCColor whiteColor];
306+
title.positionType = CCPositionTypeNormalized;
307+
title.position = ccp(0.25f, 0.5f);
308+
title.horizontalAlignment = CCTextAlignmentCenter;
309+
310+
[self.contentNode addChild:title];
311+
}
312+
313+
{
314+
CCSprite *sprite = [CCSprite spriteWithImageNamed:@"Images/particles.png"];
315+
sprite.positionType = CCPositionTypeNormalized;
316+
sprite.position = ccp(0.75f, 0.35f);
317+
318+
CCEffectColorChannelOffset *offset = [CCEffectColorChannelOffset effectWithRedOffset:GLKVector2Make(5.0f, 0.0f) greenOffset:GLKVector2Make(-4.0f, 4.0f) blueOffset:GLKVector2Make(-4.0f, -4.0f)];
319+
offset.padding = CGSizeMake(5.0f, 5.0f);
320+
CCEffectHue *hue = [CCEffectHue effectWithHue:60.0f];
321+
sprite.effect = [CCEffectStack effectWithArray:@[offset, hue]];
322+
323+
[self.contentNode addChild:sprite];
324+
325+
CCLabelTTF *title = [CCLabelTTF labelWithString:@"Padded effect stack (offset then hue)" fontName:@"HelveticaNeue-Light" fontSize:14 * [CCDirector sharedDirector].UIScaleFactor];
326+
title.color = [CCColor whiteColor];
327+
title.positionType = CCPositionTypeNormalized;
328+
title.position = ccp(0.25f, 0.35f);
329+
title.horizontalAlignment = CCTextAlignmentCenter;
330+
331+
[self.contentNode addChild:title];
332+
}
333+
334+
{
335+
CCSprite *sprite = [CCSprite spriteWithImageNamed:@"Images/particles.png"];
336+
sprite.positionType = CCPositionTypeNormalized;
337+
sprite.position = ccp(0.75f, 0.2f);
338+
339+
CCEffectColorChannelOffset *offset = [CCEffectColorChannelOffset effectWithRedOffset:GLKVector2Make(5.0f, 0.0f) greenOffset:GLKVector2Make(-4.0f, 4.0f) blueOffset:GLKVector2Make(-4.0f, -4.0f)];
340+
offset.padding = CGSizeMake(5.0f, 5.0f);
341+
CCEffectHue *hue = [CCEffectHue effectWithHue:60.0f];
342+
sprite.effect = [CCEffectStack effectWithArray:@[hue, offset]];
343+
344+
[self.contentNode addChild:sprite];
345+
346+
CCLabelTTF *title = [CCLabelTTF labelWithString:@"Padded efect stack (hue then offset)" fontName:@"HelveticaNeue-Light" fontSize:14 * [CCDirector sharedDirector].UIScaleFactor];
347+
title.color = [CCColor whiteColor];
348+
title.positionType = CCPositionTypeNormalized;
349+
title.position = ccp(0.25f, 0.2f);
350+
title.horizontalAlignment = CCTextAlignmentCenter;
351+
352+
[self.contentNode addChild:title];
353+
}
354+
}
355+
356+
-(void)setupColorChannelOffsetTest
357+
{
358+
self.subTitle = @"Color Channel Offset Effect Test";
359+
360+
CCEffectColorChannelOffset *effect = [CCEffectColorChannelOffset effectWithRedOffset:GLKVector2Make(0.0f, 0.0f) greenOffset:GLKVector2Make(0.0f, 0.0f) blueOffset:GLKVector2Make(0.0f, 0.0f)];
361+
effect.padding = CGSizeMake(5.0f, 5.0f);
362+
363+
CCSprite *sprite = [CCSprite spriteWithImageNamed:@"Images/particles.png"];
364+
sprite.scale = 1.0f;
365+
sprite.positionType = CCPositionTypeNormalized;
366+
sprite.position = ccp(0.5f, 0.5f);
367+
sprite.effect = effect;
368+
369+
[self.contentNode addChild:sprite];
370+
371+
const float thetaStep = CC_DEGREES_TO_RADIANS(10.0f);
372+
__block float redTheta = CC_DEGREES_TO_RADIANS(0.0f);
373+
__block float greenTheta = CC_DEGREES_TO_RADIANS(120.0f);
374+
__block float blueTheta = CC_DEGREES_TO_RADIANS(240.0f);
375+
void (^updateBlock)() = ^{
376+
377+
float redRadius = 3.0f;
378+
effect.redOffset = GLKVector2Make(redRadius * cosf(redTheta), redRadius * sinf(redTheta));
379+
380+
float greenRadius = 3.0f;
381+
effect.greenOffset = GLKVector2Make(greenRadius * cosf(greenTheta), greenRadius * sinf(greenTheta));
382+
383+
float blueRadius = 3.0f;
384+
effect.blueOffset = GLKVector2Make(blueRadius * cosf(blueTheta), blueRadius * sinf(blueTheta));
385+
386+
redTheta += thetaStep;
387+
greenTheta += thetaStep;
388+
blueTheta += thetaStep;
389+
};
390+
updateBlock();
391+
392+
[sprite runAction:[CCActionRepeatForever actionWithAction:[CCActionSequence actions:
393+
[CCActionDelay actionWithDuration:0.1f],
394+
[CCActionCallBlock actionWithBlock:updateBlock],
395+
nil
396+
]]];
397+
}
398+
254399
#pragma mark DropShadow
255400

256401
-(void)setupDropShadowEffectTest
@@ -659,13 +804,14 @@ -(void)setupBloomEffectTest
659804
const int steps = 5;
660805
for (int i = 0; i < steps; i++)
661806
{
662-
CCSprite *sampleSprite3 = [CCSprite spriteWithImageNamed:@"Images/grossini_dance_08.png"];
807+
CCSprite *sampleSprite3 = [CCSprite spriteWithImageNamed:@"Images/f1.png"];
663808
sampleSprite3.anchorPoint = ccp(0.5, 0.5);
664809
sampleSprite3.position = ccp(0.1f + i * (0.8f / (steps - 1)), 0.2f);
665810
sampleSprite3.positionType = CCPositionTypeNormalized;
666811

667812
// Blend glow maps test
668-
CCEffectBloom* glowEffect3 = [CCEffectBloom effectWithBlurRadius:3 intensity:1.0f luminanceThreshold:1.0f - ((float)i/(float)(steps-1))];
813+
CCEffectBloom* glowEffect3 = [CCEffectBloom effectWithBlurRadius:8 intensity:1.0f luminanceThreshold:1.0f - ((float)i/(float)(steps-1))];
814+
glowEffect3.padding = CGSizeMake(10.0f, 10.0f);
669815
sampleSprite3.effect = glowEffect3;
670816

671817
[self.contentNode addChild:sampleSprite3];

0 commit comments

Comments
 (0)