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
527
527
sprite.position = ccp (0 .5f , 0 .5f );
528
528
sprite.scale = 0 .5f ;
529
529
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]]];
532
532
533
533
sprite.normalMapSpriteFrame = [CCSpriteFrame frameWithImageNamed: @" Images/ShinyBallNormals.png" ];
534
534
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
662
662
}
663
663
else if (effects.count > 1 )
664
664
{
665
- CCEffectStack *stack = [[ CCEffectStack alloc ] initWithEffects : effects];
665
+ CCEffectStack *stack = [CCEffectStack effectStackWithEffects : effects];
666
666
effectNode.effect = stack;
667
667
}
668
668
@@ -683,7 +683,7 @@ - (CCSprite *)spriteWithEffects:(NSArray *)effects image:(NSString *)spriteImage
683
683
}
684
684
else if (effects.count > 1 )
685
685
{
686
- CCEffectStack *stack = [[ CCEffectStack alloc ] initWithEffects : effects];
686
+ CCEffectStack *stack = [CCEffectStack effectStackWithEffects : effects];
687
687
sprite.effect = stack;
688
688
}
689
689
Original file line number Diff line number Diff line change 38
38
- (id )init ;
39
39
40
40
/* *
41
- * Initializes an empty effect stack object.
41
+ * Initializes an effect stack object with the specified array of effects .
42
42
*
43
43
* @param effects The array of effects to add to the stack.
44
44
*
47
47
- (id )initWithEffects : (NSArray *)effects ;
48
48
49
49
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
+
50
64
// / -----------------------------------------------------------------------
51
65
// / @name Accessing Contained Effects
52
66
// / -----------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -46,6 +46,11 @@ - (id)initWithEffects:(NSArray *)effects
46
46
return self;
47
47
}
48
48
49
+ + (id )effectStackWithEffects : (NSArray *)effects
50
+ {
51
+ return [[self alloc ] initWithEffects: effects];
52
+ }
53
+
49
54
- (NSUInteger )effectCount
50
55
{
51
56
return _effects.count ;
You can’t perform that action at this time.
0 commit comments