Skip to content

Commit 050ec5d

Browse files
committed
Changed shortcut method name for glow effect.
1 parent 85aa5c0 commit 050ec5d

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

cocos2d-ui-tests/tests/CCEffectsTest.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ -(void)setupGlowEffectNodeTest
105105
glowEffectNode.positionType = CCPositionTypeNormalized;
106106
glowEffectNode.position = ccp(0.1, 0.5);
107107
[glowEffectNode addChild:sampleSprite];
108-
CCEffectGlow* glowEffect = [CCEffectGlow effectWithRadius:0.01f];
108+
CCEffectGlow* glowEffect = [CCEffectGlow effectWithBlurStrength:0.02f];
109109
[glowEffectNode addEffect:glowEffect];
110110

111111
CGSize size = CGSizeMake(1.0, 1.0);

cocos2d/CCEffectGlow.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
#if CC_ENABLE_EXPERIMENTAL_EFFECTS
1212
@interface CCEffectGlow : CCEffect
1313

14-
@property (nonatomic) float blurRadius;
14+
@property (nonatomic) float blurStrength;
1515

16-
-(id)initWithBlurRadius:(float)blurRadius;
17-
+(id)effectWithRadius:(float)blurRadius;
16+
-(id)initWithbBurStrength:(float)blurStrength;
17+
+(id)effectWithBlurStrength:(float)blurStrength;
1818

1919
@end
2020
#endif

cocos2d/CCEffectGlow.m

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,20 @@ -(id)init
3636
return self;
3737
}
3838

39-
40-
-(id)initWithBlurRadius:(float)blurRadius
39+
-(id)initWithbBurStrength:(float)blurStrength
4140
{
4241
if((self = [self init]))
4342
{
44-
_blurRadius = blurRadius;
43+
_blurStrength = blurStrength;
4544
return self;
4645
}
4746

4847
return self;
4948
}
5049

51-
+(id)effectWithRadius:(float)blurRadius;
50+
+(id)effectWithBlurStrength:(float)blurStrength
5251
{
53-
return [[self alloc] initWithBlurRadius:blurRadius];
52+
return [[self alloc] initWithbBurStrength:blurStrength];
5453
}
5554

5655
-(void)buildFragmentFunctions
@@ -121,12 +120,12 @@ -(void)renderPassBegin:(CCEffectRenderPass*)renderPass defaultBlock:(void (^)())
121120
if(renderPass.renderPassId == 0)
122121
{
123122
renderPass.sprite.shaderUniforms[@"u_enableGlowMap"] = [NSNumber numberWithFloat:0.0f];
124-
renderPass.sprite.shaderUniforms[@"u_blurDirection"] = [NSValue valueWithGLKVector2:GLKVector2Make(_blurRadius, 0.0f)];
123+
renderPass.sprite.shaderUniforms[@"u_blurDirection"] = [NSValue valueWithGLKVector2:GLKVector2Make(_blurStrength, 0.0f)];
125124
}
126125
else if(renderPass.renderPassId == 1)
127126
{
128127
renderPass.sprite.shaderUniforms[@"u_enableGlowMap"] = [NSNumber numberWithFloat:0.0f];
129-
renderPass.sprite.shaderUniforms[@"u_blurDirection"] = [NSValue valueWithGLKVector2:GLKVector2Make(0.0f, _blurRadius)];
128+
renderPass.sprite.shaderUniforms[@"u_blurDirection"] = [NSValue valueWithGLKVector2:GLKVector2Make(0.0f, _blurStrength)];
130129
}
131130
else if(renderPass.renderPassId == 2)
132131
{

0 commit comments

Comments
 (0)