@@ -2047,10 +2047,58 @@ var labelTTFDrawModeTest = AtlasDemo.extend({
2047
2047
}
2048
2048
} ) ;
2049
2049
2050
+ var NewLabelTest = AtlasDemo . extend ( {
2051
+ _testLabel : null ,
2052
+ _labelAlignCode : 0 ,
2053
+ ctor :function ( ) {
2054
+ this . _super ( ) ;
2055
+ var testLabel = new cc . Label ( "Times" ) ;
2056
+ testLabel . setFontSize ( 40 ) ;
2057
+ testLabel . setContentSize ( cc . size ( 480 , 320 ) ) ;
2058
+ testLabel . enableWrapText ( false ) ;
2059
+ testLabel . setOverflow ( cc . Label . Overflow . CLAMP ) ;
2060
+ this . _testLabel = testLabel ;
2061
+ testLabel . x = 100 ;
2062
+ testLabel . y = 50 ;
2063
+ var sentence = "a short sentence.\n" +
2064
+ "this is the second paragraph it could be long.\n" +
2065
+ "中文的长句子中文的长句子中文的长句子中文的长句子中文的长句子长句子.\n" +
2066
+ "中文的长句子中文的长句子中文的长句子中文的长句子中文的长句子长句子第四段短句" ;
2067
+ testLabel . setString ( sentence ) ;
2068
+ this . updateLabelAlign ( this . _labelAlignCode ) ;
2069
+ this . schedule ( this . scheduleLabel , 2 ) ;
2070
+ this . addChild ( testLabel ) ;
2071
+
2072
+ //testLabel = new cc.Label();
2073
+ //testLabel.x = 200;
2074
+ //testLabel.y = 300;
2075
+ //testLabel.setString(" Test Label");
2076
+ //this.addChild(testLabel);
2077
+ } ,
2078
+ scheduleLabel : function ( dt ) {
2079
+ this . _labelAlignCode ++ ;
2080
+ this . updateLabelAlign ( this . _labelAlignCode ) ;
2081
+ } ,
2082
+ updateLabelAlign : function ( value ) {
2083
+ value = value % 9 ;
2084
+ var valuex = value % 3 ;
2085
+ var valuey = ( value / 3 ) | 0 ;
2086
+ this . _testLabel . setVerticalAlign ( valuey ) ;
2087
+ this . _testLabel . setHorizontalAlign ( valuex ) ;
2088
+ } ,
2089
+ title :function ( ) {
2090
+ return "NewLabelTest" ;
2091
+ } ,
2092
+ subtitle :function ( ) {
2093
+ return "TTF new label" ;
2094
+ }
2095
+ } ) ;
2096
+
2050
2097
//
2051
2098
// Flow control
2052
2099
//
2053
2100
var arrayOfLabelTest = [
2101
+ NewLabelTest ,
2054
2102
LabelAtlasOpacityTest ,
2055
2103
LabelAtlasOpacityColorTest ,
2056
2104
LabelAtlasHD ,
0 commit comments