Permalink
Browse files

Added test for LabelTTF multiline

  • Loading branch information...
ricardoquesada committed Jul 7, 2012
1 parent 18278aa commit f015b001fc18681fa6ab87d65a0a57844f509cc3
Showing with 38 additions and 1 deletion.
  1. +2 −1 CHANGELOG
  2. +5 −0 tests/LabelTest.h
  3. +31 −0 tests/LabelTest.m
View
@@ -1,4 +1,5 @@
-version 2.0 XX-Jun-2012
+version 2.0 XX-Jul-2012
+. [FIX] LabelTTF: supports multiline even if no dimensions are provided
. [FIX] Macros: CCLOGERROR defined in ccDeprecated as CCLOGWARN
. [FIX] Scheduler: removeUpdateFromHash calls [target release] at the very end to prevent a possible crash
. [FIX] TexturePVR: wrong type when calculating PVR lenght
View
@@ -118,6 +118,11 @@
}
@end
+@interface LabelTTFMultiline2 : AtlasDemo
+{
+}
+@end
+
@interface LabelTTFA8Test : AtlasDemo
{
View
@@ -28,6 +28,7 @@
@"LabelGlyphDesigner",
@"LabelTTFTest",
@"LabelTTFMultiline",
+ @"LabelTTFMultiline2",
@"LabelTTFA8Test",
@"LabelTTFLineBreak",
@"BMFontOneAtlas",
@@ -1466,9 +1467,39 @@ -(NSString *) subtitle
{
return @"Word wrap using CCLabelTTF and a custom TTF font";
}
+@end
+
+#pragma mark -
+#pragma mark LabelTTFMultiline2
+
+@implementation LabelTTFMultiline2
+-(id) init
+{
+ if( (self=[super init]) ) {
+
+ CGSize s = [[CCDirector sharedDirector] winSize];
+
+ CCLabelTTF *label = [CCLabelTTF labelWithString:@"Line 1\nThis is line 2\nAnd this is line 3" fontName:@"Marker Felt" fontSize:32];
+ label.position = ccp(s.width/2,s.height/2);
+
+ [self addChild:label];
+ }
+
+ return self;
+}
+
+-(NSString*) title
+{
+ return @"Testing CCLabelTTF multiline";
+}
+-(NSString *) subtitle
+{
+ return @"Multiline wihtout dimensions";
+}
@end
+
#pragma mark -
#pragma mark LabelTTFA8Test

0 comments on commit f015b00

Please sign in to comment.