@@ -84,8 +84,8 @@ - (id) initWithTitle:(NSString*) title spriteFrame:(CCSpriteFrame*) spriteFrame
84
84
[self setBackgroundColor: [CCColor colorWithWhite: 0.7 alpha: 1 ] forState: CCControlStateHighlighted];
85
85
[self setLabelColor: [CCColor colorWithWhite: 0.7 alpha: 1 ] forState: CCControlStateHighlighted];
86
86
87
- [self setBackgroundOpacity: 127 forState: CCControlStateDisabled];
88
- [self setLabelOpacity: 127 forState: CCControlStateDisabled];
87
+ [self setBackgroundOpacity: 0 . 5f forState: CCControlStateDisabled];
88
+ [self setLabelOpacity: 0 . 5f forState: CCControlStateDisabled];
89
89
90
90
return self;
91
91
}
@@ -489,15 +489,15 @@ - (void) setValue:(id)value forKey:(NSString *)key state:(CCControlState)state
489
489
{
490
490
if ([key isEqualToString: @" labelOpacity" ])
491
491
{
492
- [self setLabelOpacity: [value intValue ] forState: state];
492
+ [self setLabelOpacity: [value floatValue ] forState: state];
493
493
}
494
494
else if ([key isEqualToString: @" labelColor" ])
495
495
{
496
496
[self setLabelColor: value forState: state];
497
497
}
498
498
else if ([key isEqualToString: @" backgroundOpacity" ])
499
499
{
500
- [self setBackgroundOpacity: [value intValue ] forState: state];
500
+ [self setBackgroundOpacity: [value floatValue ] forState: state];
501
501
}
502
502
else if ([key isEqualToString: @" backgroundColor" ])
503
503
{
@@ -513,15 +513,15 @@ - (id) valueForKey:(NSString *)key state:(CCControlState)state
513
513
{
514
514
if ([key isEqualToString: @" labelOpacity" ])
515
515
{
516
- return [NSNumber numberWithUnsignedChar : [self labelOpacityForState: state]];
516
+ return [NSNumber numberWithFloat : [self labelOpacityForState: state]];
517
517
}
518
518
else if ([key isEqualToString: @" labelColor" ])
519
519
{
520
520
return [self labelColorForState: state];
521
521
}
522
522
else if ([key isEqualToString: @" backgroundOpacity" ])
523
523
{
524
- return [NSNumber numberWithUnsignedChar : [self backgroundOpacityForState: state]];
524
+ return [NSNumber numberWithFloat : [self backgroundOpacityForState: state]];
525
525
}
526
526
else if ([key isEqualToString: @" backgroundColor" ])
527
527
{
0 commit comments