@@ -110,7 +110,7 @@ - (id) initWithAttributedString:(NSAttributedString *)attrString dimensions:(CGS
110
110
}
111
111
112
112
// This is a private initializer
113
- - (id ) initWithAttributedString : (NSAttributedString *)attrString fontName : (NSString *)fontName fontSize : (float )fontSize dimensions : (CGSize)dimensions
113
+ - (id ) initWithAttributedString : (NSAttributedString *)attrString fontName : (NSString *)fontName fontSize : (CGFloat )fontSize dimensions : (CGSize)dimensions
114
114
{
115
115
if ( (self = [super init ]) )
116
116
{
@@ -181,7 +181,7 @@ - (void)setFontName:(NSString*)fontName
181
181
}
182
182
}
183
183
184
- - (void ) setFontSize : (float )fontSize
184
+ - (void ) setFontSize : (CGFloat )fontSize
185
185
{
186
186
if ( fontSize != _fontSize ) {
187
187
_fontSize = fontSize;
@@ -207,7 +207,7 @@ - (void) setFontColor:(CCColor*)fontColor
207
207
}
208
208
}
209
209
210
- - (void ) setMinimumFontSize : (float )minimumFontSize
210
+ - (void ) setMinimumFontSize : (CGFloat )minimumFontSize
211
211
{
212
212
if (minimumFontSize != _minimumFontSize)
213
213
{
@@ -274,7 +274,7 @@ -(CGPoint)shadowOffsetInPoints
274
274
return [self convertPositionToPoints: self .shadowOffset type: _shadowOffsetType];
275
275
}
276
276
277
- - (void ) setShadowBlurRadius : (float )shadowBlurRadius
277
+ - (void ) setShadowBlurRadius : (CGFloat )shadowBlurRadius
278
278
{
279
279
if (_shadowBlurRadius != shadowBlurRadius)
280
280
{
@@ -292,7 +292,7 @@ - (void) setOutlineColor:(CCColor*)outlineColor
292
292
}
293
293
}
294
294
295
- - (void ) setOutlineWidth : (float )outlineWidth
295
+ - (void ) setOutlineWidth : (CGFloat )outlineWidth
296
296
{
297
297
if (outlineWidth != _outlineWidth)
298
298
{
@@ -484,27 +484,27 @@ - (CCTexture*) createTextureWithAttributedString:(NSAttributedString*)attributed
484
484
485
485
CGSize originalDimensions = _dimensions;
486
486
487
- CGFloat scale = [CCDirector sharedDirector ].contentScaleFactor ;
487
+ CGFloat scale = [CCDirector sharedDirector ].contentScaleFactor ;
488
488
originalDimensions.width *= scale;
489
489
originalDimensions.height *= scale;
490
490
491
491
CGSize dimensions = originalDimensions;
492
492
493
- float shadowBlurRadius = _shadowBlurRadius * scale;
493
+ CGFloat shadowBlurRadius = _shadowBlurRadius * scale;
494
494
CGPoint shadowOffset = ccpMult (self.shadowOffsetInPoints , scale);
495
- float outlineWidth = _outlineWidth * scale;
495
+ CGFloat outlineWidth = _outlineWidth * scale;
496
496
497
497
BOOL hasShadow = (_shadowColor.alpha > 0 );
498
498
BOOL hasOutline = (_outlineColor.alpha > 0 && _outlineWidth > 0 );
499
499
500
- float xOffset = 0 ;
501
- float yOffset = 0 ;
502
- float scaleFactor = 1 ;
500
+ CGFloat xOffset = 0 ;
501
+ CGFloat yOffset = 0 ;
502
+ CGFloat scaleFactor = 1 ;
503
503
504
- float xPadding = 0 ;
505
- float yPadding = 0 ;
506
- float wDrawArea = 0 ;
507
- float hDrawArea = 0 ;
504
+ CGFloat xPadding = 0 ;
505
+ CGFloat yPadding = 0 ;
506
+ CGFloat wDrawArea = 0 ;
507
+ CGFloat hDrawArea = 0 ;
508
508
509
509
// Calculate padding
510
510
if (hasShadow)
@@ -542,7 +542,7 @@ - (CCTexture*) createTextureWithAttributedString:(NSAttributedString*)attributed
542
542
// Handle strings with fixed dimensions
543
543
if (_adjustsFontSizeToFit)
544
544
{
545
- float fontSize = [attributedString singleFontSize ];
545
+ CGFloat fontSize = [attributedString singleFontSize ];
546
546
if (fontSize)
547
547
{
548
548
// This is a string that can be resized (it only uses one font and size)
@@ -552,8 +552,8 @@ - (CCTexture*) createTextureWithAttributedString:(NSAttributedString*)attributed
552
552
CGSize wantedSize = [attributedString boundingRectWithSize: CGSizeZero options: NSStringDrawingUsesLineFragmentOrigin].size ;
553
553
#endif
554
554
555
- float wScaleFactor = 1 ;
556
- float hScaleFactor = 1 ;
555
+ CGFloat wScaleFactor = 1 ;
556
+ CGFloat hScaleFactor = 1 ;
557
557
if (wantedSize.width > wDrawArea)
558
558
{
559
559
wScaleFactor = wDrawArea/wantedSize.width ;
@@ -568,8 +568,8 @@ - (CCTexture*) createTextureWithAttributedString:(NSAttributedString*)attributed
568
568
569
569
if (scaleFactor != 1 )
570
570
{
571
- float newFontSize = fontSize * scaleFactor;
572
- float minFontSize = _minimumFontSize * scale;
571
+ CGFloat newFontSize = fontSize * scaleFactor;
572
+ CGFloat minFontSize = _minimumFontSize * scale;
573
573
if (minFontSize && newFontSize < minFontSize) newFontSize = minFontSize;
574
574
attributedString = [attributedString copyWithNewFontSize: newFontSize];
575
575
}
@@ -682,7 +682,7 @@ - (CCTexture*) createTextureWithAttributedString:(NSAttributedString*)attributed
682
682
[[NSAffineTransform transform ] set ];
683
683
684
684
// XXX: The shadows are for some reason scaled on OS X if a retina display is connected
685
- float retinaFix = 1 ;
685
+ CGFloat retinaFix = 1 ;
686
686
for (NSScreen * screen in [NSScreen screens ])
687
687
{
688
688
if (screen.backingScaleFactor > retinaFix) retinaFix = screen.backingScaleFactor ;
@@ -802,23 +802,23 @@ - (BOOL) updateTextureOld
802
802
- (CCTexture*) createTextureWithString : (NSString *) string useFullColor : (BOOL )useFullColor
803
803
{
804
804
// Scale everything up by content scale
805
- CGFloat scale = [CCDirector sharedDirector ].contentScaleFactor ;
805
+ CGFloat scale = [CCDirector sharedDirector ].contentScaleFactor ;
806
806
UIFont* font = [UIFont fontWithName: _fontName size: _fontSize * scale];
807
- float shadowBlurRadius = _shadowBlurRadius * scale;
807
+ CGFloat shadowBlurRadius = _shadowBlurRadius * scale;
808
808
CGPoint shadowOffset = ccpMult (self.shadowOffsetInPoints , scale);
809
- float outlineWidth = _outlineWidth * scale;
809
+ CGFloat outlineWidth = _outlineWidth * scale;
810
810
811
811
BOOL hasShadow = (_shadowColor.alpha > 0 );
812
812
BOOL hasOutline = (_outlineColor.alpha > 0 && _outlineWidth > 0 );
813
813
814
- float xOffset = 0 ;
815
- float yOffset = 0 ;
816
- float scaleFactor = 1 ;
814
+ CGFloat xOffset = 0 ;
815
+ CGFloat yOffset = 0 ;
816
+ CGFloat scaleFactor = 1 ;
817
817
818
- float xPadding = 0 ;
819
- float yPadding = 0 ;
820
- float wDrawArea = 0 ;
821
- float hDrawArea = 0 ;
818
+ CGFloat xPadding = 0 ;
819
+ CGFloat yPadding = 0 ;
820
+ CGFloat wDrawArea = 0 ;
821
+ CGFloat hDrawArea = 0 ;
822
822
823
823
CGSize originalDimensions = _dimensions;
824
824
originalDimensions.width *= scale;
@@ -866,12 +866,12 @@ - (CCTexture*) createTextureWithString:(NSString*) string useFullColor:(BOOL)use
866
866
// Handle strings with fixed dimensions
867
867
if (_adjustsFontSizeToFit)
868
868
{
869
- float fontSize = font.pointSize ;
869
+ CGFloat fontSize = font.pointSize ;
870
870
CGSize wantedSizeFirstLine = [string sizeWithFont: font];
871
871
CGSize wantedSize = [string sizeWithFont: font constrainedToSize: CGSizeMake (wantedSizeFirstLine.width, 1024 ) lineBreakMode: 0 ];
872
872
873
- float wScaleFactor = 1 ;
874
- float hScaleFactor = 1 ;
873
+ CGFloat wScaleFactor = 1 ;
874
+ CGFloat hScaleFactor = 1 ;
875
875
if (wantedSize.width > wDrawArea)
876
876
{
877
877
wScaleFactor = wDrawArea/wantedSize.width ;
@@ -886,8 +886,8 @@ - (CCTexture*) createTextureWithString:(NSString*) string useFullColor:(BOOL)use
886
886
887
887
if (scaleFactor != 1 )
888
888
{
889
- float newFontSize = fontSize * scaleFactor;
890
- float minFontSize = _minimumFontSize * scale;
889
+ CGFloat newFontSize = fontSize * scaleFactor;
890
+ CGFloat minFontSize = _minimumFontSize * scale;
891
891
if (minFontSize && newFontSize < minFontSize) newFontSize = minFontSize;
892
892
font = [UIFont fontWithName: font.fontName size: newFontSize];
893
893
}
0 commit comments