File tree Expand file tree Collapse file tree 3 files changed +24
-5
lines changed Expand file tree Collapse file tree 3 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -527,8 +527,8 @@ -(void)setupStackTest
527527 sprite.position = ccp (0 .5f , 0 .5f );
528528 sprite.scale = 0 .5f ;
529529
530- sprite.effect = [[ CCEffectStack alloc ] initWithEffects : @[effects[8 ], effects[9 ]]];
531- // sprite.effect = [[ CCEffectStack alloc] initWithEffects :@[effects[7]]];
530+ sprite.effect = [CCEffectStack effectStackWithEffects : @[effects[8 ], effects[9 ]]];
531+ // sprite.effect = [CCEffectStack effectStackWithEffects :@[effects[7]]];
532532
533533 sprite.normalMapSpriteFrame = [CCSpriteFrame frameWithImageNamed: @" Images/ShinyBallNormals.png" ];
534534 sprite.colorRGBA = [CCColor colorWithRed: 0 .75f green: 0 .75f blue: 0 .75f alpha: 0 .75f ];
@@ -662,7 +662,7 @@ - (CCNode *)effectNodeWithEffects:(NSArray *)effects appliedToSpriteWithImage:(N
662662 }
663663 else if (effects.count > 1 )
664664 {
665- CCEffectStack *stack = [[ CCEffectStack alloc ] initWithEffects : effects];
665+ CCEffectStack *stack = [CCEffectStack effectStackWithEffects : effects];
666666 effectNode.effect = stack;
667667 }
668668
@@ -683,7 +683,7 @@ - (CCSprite *)spriteWithEffects:(NSArray *)effects image:(NSString *)spriteImage
683683 }
684684 else if (effects.count > 1 )
685685 {
686- CCEffectStack *stack = [[ CCEffectStack alloc ] initWithEffects : effects];
686+ CCEffectStack *stack = [CCEffectStack effectStackWithEffects : effects];
687687 sprite.effect = stack;
688688 }
689689
Original file line number Diff line number Diff line change 3838- (id )init ;
3939
4040/* *
41- * Initializes an empty effect stack object.
41+ * Initializes an effect stack object with the specified array of effects .
4242 *
4343 * @param effects The array of effects to add to the stack.
4444 *
4747- (id )initWithEffects : (NSArray *)effects ;
4848
4949
50+ // / -----------------------------------------------------------------------
51+ // / @name Creating a CCEffectStack object
52+ // / -----------------------------------------------------------------------
53+
54+ /* *
55+ * Creates an effect stack object with the specified array of effects.
56+ *
57+ * @param effects The array of effects to add to the stack.
58+ *
59+ * @return The CCEffectStack object.
60+ */
61+ + (id )effectStackWithEffects : (NSArray *)effects ;
62+
63+
5064// / -----------------------------------------------------------------------
5165// / @name Accessing Contained Effects
5266// / -----------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -46,6 +46,11 @@ - (id)initWithEffects:(NSArray *)effects
4646 return self;
4747}
4848
49+ + (id )effectStackWithEffects : (NSArray *)effects
50+ {
51+ return [[self alloc ] initWithEffects: effects];
52+ }
53+
4954- (NSUInteger )effectCount
5055{
5156 return _effects.count ;
You can’t perform that action at this time.
0 commit comments