Skip to content

Commit 90574a8

Browse files
committed
Styled TTF label tests.
1 parent 143a620 commit 90574a8

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

cocos2d-ui-tests/osx/AppDelegate.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
4747
[fileUtils buildSearchResolutionsOrder];
4848

4949
[fileUtils loadFilenameLookupDictionaryFromFile:@"fileLookup.plist"];
50+
51+
// Register spritesheets.
52+
[[CCSpriteFrameCache sharedSpriteFrameCache] registerSpriteFramesFile:@"Interface.plist"];
53+
[[CCSpriteFrameCache sharedSpriteFrameCache] registerSpriteFramesFile:@"Sprites.plist"];
54+
[[CCSpriteFrameCache sharedSpriteFrameCache] registerSpriteFramesFile:@"TilesAtlassed.plist"];
5055

5156

5257
[director runWithScene:[MainMenu scene]];

cocos2d-ui-tests/tests/CCLabelTTFTest.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ - (void)showFont:(NSString *)aFont
8484
[self.contentNode removeAllChildren ];
8585

8686
CCLabelTTF *top = [CCLabelTTF labelWithString:aFont fontName:aFont fontSize:24];
87+
top.outlineColor = [CCColor blackColor];
88+
top.outlineWidth = 1.0;
89+
top.shadowColor = [CCColor whiteColor];
90+
top.shadowBlurRadius = 2.0;
91+
top.shadowOffset = ccp(1.0, -1.0);
92+
8793
CCLabelTTF *left = [CCLabelTTF labelWithString:@"alignment left" fontName:aFont fontSize:fontSize dimensions:blockSize];
8894
CCLabelTTF *center = [CCLabelTTF labelWithString:@"alignment center" fontName:aFont fontSize:fontSize dimensions:blockSize];
8995
CCLabelTTF *right = [CCLabelTTF labelWithString:@"alignment right" fontName:aFont fontSize:fontSize dimensions:blockSize];
@@ -105,7 +111,7 @@ - (void)showFont:(NSString *)aFont
105111
center.anchorPoint = centerColor.anchorPoint = ccp(0,0.5);
106112
right.anchorPoint = rightColor.anchorPoint = ccp(0,0.5);
107113

108-
top.position = ccp(s.width/2,s.height-60);
114+
top.position = ccp(s.width/2,s.height-80);
109115
left.position = leftColor.position = ccp(0,s.height/3);
110116
center.position = centerColor.position = ccp(blockSize.width, s.height/3);
111117
right.position = rightColor.position = ccp(blockSize.width*2, s.height/3);
@@ -117,7 +123,6 @@ - (void)showFont:(NSString *)aFont
117123
[self.contentNode addChild:centerColor z:-1];
118124
[self.contentNode addChild:center z:0];
119125
[self.contentNode addChild:top z:0 ];
120-
121126
}
122127

123128

0 commit comments

Comments
 (0)