mirror of https://github.com/axmolengine/axmol.git
update test cast of label.
This commit is contained in:
parent
0cd42a3f39
commit
791737befa
|
@ -62,7 +62,6 @@ static std::function<Layer*()> createFunctions[] =
|
|||
CL(LabelTTFAlignmentNew),
|
||||
CL(LabelFNTBounds),
|
||||
CL(LabelTTFLongLineWrapping),
|
||||
CL(LabelTTFLargeText),
|
||||
CL(LabelTTFColor),
|
||||
CL(LabelTTFFontsTestNew),
|
||||
CL(LabelTTFDynamicAlignment),
|
||||
|
@ -606,7 +605,7 @@ LabelTTFUnicodeChinese::LabelTTFUnicodeChinese()
|
|||
auto size = Director::getInstance()->getWinSize();
|
||||
// Adding "啊" letter at the end of string to make VS2012 happy, otherwise VS will generate errors
|
||||
// like "Error 3 error C2146: syntax error : missing ')' before identifier 'label'";
|
||||
TTFConfig ttfConfig("fonts/wt021.ttf",28,GlyphCollection::CUSTOM, "美好的一天啊");
|
||||
TTFConfig ttfConfig("fonts/HKYuanMini.ttf",28,GlyphCollection::CUSTOM, "美好的一天啊");
|
||||
auto label = Label::createWithTTF(ttfConfig,"美好的一天啊", TextHAlignment::CENTER, size.width);
|
||||
|
||||
if(label) {
|
||||
|
@ -962,30 +961,6 @@ std::string LabelTTFLongLineWrapping::subtitle() const
|
|||
return "Uses the new Label with TTF. Testing auto-wrapping";
|
||||
}
|
||||
|
||||
LabelTTFLargeText::LabelTTFLargeText()
|
||||
{
|
||||
auto size = Director::getInstance()->getWinSize();
|
||||
|
||||
// Long sentence
|
||||
TTFConfig ttfConfig("fonts/wt021.ttf",18,GlyphCollection::DYNAMIC);
|
||||
std::string text = FileUtils::getInstance()->getStringFromFile("commonly_used_words.txt");
|
||||
auto label = Label::createWithTTF(ttfConfig,text, TextHAlignment::CENTER, size.width);
|
||||
if(label) {
|
||||
label->setPosition( Vec2(size.width/2, size.height/2) );
|
||||
addChild(label);
|
||||
}
|
||||
}
|
||||
|
||||
std::string LabelTTFLargeText::title() const
|
||||
{
|
||||
return "New Label + .TTF";
|
||||
}
|
||||
|
||||
std::string LabelTTFLargeText::subtitle() const
|
||||
{
|
||||
return "Uses the new Label with TTF. Testing large text";
|
||||
}
|
||||
|
||||
LabelTTFColor::LabelTTFColor()
|
||||
{
|
||||
auto size = Director::getInstance()->getWinSize();
|
||||
|
@ -1093,7 +1068,7 @@ LabelTTFCJKWrappingTest::LabelTTFCJKWrappingTest()
|
|||
Vec2(size.width * 0.85, size.height * 0.8),
|
||||
Vec2(size.width * 0.85, 0), 1, Color4F(1, 0, 0, 1));
|
||||
|
||||
TTFConfig ttfConfig("fonts/wt021.ttf", 25, GlyphCollection::DYNAMIC);
|
||||
TTFConfig ttfConfig("fonts/HKYuanMini.ttf", 25, GlyphCollection::DYNAMIC);
|
||||
auto label1 = Label::createWithTTF(ttfConfig,
|
||||
"你好,Cocos2d-x v3的New Label.", TextHAlignment::LEFT, size.width * 0.75);
|
||||
if(label1) {
|
||||
|
@ -1162,7 +1137,7 @@ LabelTTFUnicodeNew::LabelTTFUnicodeNew()
|
|||
addChild(label2);
|
||||
|
||||
// chinese
|
||||
ttfConfig.fontFilePath = "fonts/wt021.ttf";
|
||||
ttfConfig.fontFilePath = "fonts/HKYuanMini.ttf";
|
||||
ttfConfig.glyphs = GlyphCollection::CUSTOM;
|
||||
ttfConfig.customGlyphs = chinese.c_str();
|
||||
auto label3 = Label::createWithTTF(ttfConfig,chinese, TextHAlignment::CENTER,size.width);
|
||||
|
|
|
@ -440,17 +440,6 @@ protected:
|
|||
void onDraw(const Mat4 &transform, uint32_t flags);
|
||||
};
|
||||
|
||||
class LabelTTFLargeText : public AtlasDemoNew
|
||||
{
|
||||
public:
|
||||
CREATE_FUNC(LabelTTFLargeText);
|
||||
|
||||
LabelTTFLargeText();
|
||||
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
};
|
||||
|
||||
class LabelFontNameTest : public AtlasDemoNew
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -1,60 +0,0 @@
|
|||
三画
|
||||
三于干亏士工土才寸下大丈与万上小口巾山千乞川亿个勺久凡及夕丸么广
|
||||
亡门义之尸弓己已子卫也女飞刃习叉马乡
|
||||
|
||||
四画
|
||||
丰王井开夫天无元专云扎艺木五支厅不太犬区历尤友匹车巨牙屯比互切瓦
|
||||
止少日中冈贝内水见午牛手毛气升长仁什片仆化仇币仍仅斤爪反介父从今
|
||||
凶分乏公仓月氏勿欠风丹匀乌凤勾文六方火为斗忆订计户认心尺引丑巴孔
|
||||
队办以允予劝双书幻
|
||||
|
||||
五画
|
||||
玉刊示末未击打巧正扑扒功扔去甘世古节本术可丙左厉右石布龙平灭轧东
|
||||
卡北占业旧帅归且旦目叶甲申叮电号田由史只央兄叼叫另叨叹四生失禾丘
|
||||
付仗代仙们仪白仔他斥瓜乎丛令用甩印乐句匆册犯外处冬鸟务包饥主市立
|
||||
闪兰半汁汇头汉宁穴它讨写让礼训必议讯记永司尼民出辽奶奴加召皮边发
|
||||
孕圣对台矛纠母幼丝
|
||||
|
||||
六画
|
||||
式刑动扛寺吉扣考托老执巩圾扩扫地扬场耳共芒亚芝朽朴机权过臣再协西
|
||||
压厌在有百存而页匠夸夺灰达列死成夹轨邪划迈毕至此贞师尘尖劣光当早
|
||||
吐吓虫曲团同吊吃因吸吗屿帆岁回岂刚则肉网年朱先丢舌竹迁乔伟传乒乓
|
||||
休伍伏优伐延件任伤价份华仰仿伙伪自血向似后行舟全会杀合兆企众爷伞
|
||||
创肌朵杂危旬旨负各名多争色壮冲冰庄庆亦刘齐交次衣产决充妄闭问闯羊
|
||||
并关米灯州汗污江池汤忙兴宇守宅字安讲军许论农讽设访寻那迅尽导异孙
|
||||
阵阳收阶阴防奸如妇好她妈戏羽观欢买红纤级约纪驰巡
|
||||
|
||||
七画
|
||||
寿弄麦形进戒吞远违运扶抚坛技坏扰拒找批扯址走抄坝贡攻赤折抓扮抢孝
|
||||
均抛投坟抗坑坊抖护壳志扭块声把报却劫芽花芹芬苍芳严芦劳克苏杆杠杜
|
||||
材村杏极李杨求更束豆两丽医辰励否还歼来连步坚旱盯呈时吴助县里呆园
|
||||
旷围呀吨足邮男困吵串员听吩吹呜吧吼别岗帐财针钉告我乱利秃秀私每兵
|
||||
估体何但伸作伯伶佣低你住位伴身皂佛近彻役返余希坐谷妥含邻岔肝肚肠
|
||||
龟免狂犹角删条卵岛迎饭饮系言冻状亩况床库疗应冷这序辛弃冶忘闲间闷
|
||||
判灶灿弟汪沙汽沃泛沟没沈沉怀忧快完宋宏牢究穷灾良证启评补初社识诉
|
||||
诊词译君灵即层尿尾迟局改张忌际陆阿陈阻附妙妖妨努忍劲鸡驱纯纱纳纲
|
||||
驳纵纷纸纹纺驴纽
|
||||
|
||||
八画
|
||||
奉玩环武青责现表规抹拢拔拣担坦押抽拐拖拍者顶拆拥抵拘势抱垃拉拦拌
|
||||
幸招坡披拨择抬其取苦若茂苹苗英范直茄茎茅林枝杯柜析板松枪构杰述枕
|
||||
丧或画卧事刺枣雨卖矿码厕奔奇奋态欧垄妻轰顷转斩轮软到非叔肯齿些虎
|
||||
虏肾贤尚旺具果味昆国昌畅明易昂典固忠咐呼鸣咏呢岸岩帖罗帜岭凯败贩
|
||||
购图钓制知垂牧物乖刮秆和季委佳侍供使例版侄侦侧凭侨佩货依的迫质欣
|
||||
征往爬彼径所舍金命斧爸采受乳贪念贫肤肺肢肿胀朋股肥服胁周昏鱼兔狐
|
||||
忽狗备饰饱饲变京享店夜庙府底剂郊废净盲放刻育闸闹郑券卷单炒炊炕炎
|
||||
炉沫浅法泄河沾泪油泊沿泡注泻泳泥沸波泼泽治怖性怕怜怪学宝宗定宜审
|
||||
宙官空帘实试郎诗肩房诚衬衫视话诞询该详建肃录隶居届刷屈弦承孟孤陕
|
||||
降限妹姑姐姓始驾参艰线练组细驶织终驻驼绍经贯
|
||||
|
||||
九画
|
||||
奏春帮珍玻毒型挂封持项垮挎城挠政赴赵挡挺括拴拾挑指垫挣挤拼挖按挥
|
||||
挪某甚革荐巷带草茧茶荒茫荡荣故胡南药标枯柄栋相查柏柳柱柿栏树要咸
|
||||
威歪研砖厘厚砌砍面耐耍牵残殃轻鸦皆背战点临览竖省削尝是盼眨哄显哑
|
||||
冒映星昨畏趴胃贵界虹虾蚁思蚂虽品咽骂哗咱响哈咬咳哪炭峡罚贱贴骨钞
|
||||
钟钢钥钩卸缸拜看矩怎牲选适秒香种秋科重复竿段便俩贷顺修保促侮俭俗
|
||||
俘信皇泉鬼侵追俊盾待律很须叙剑逃食盆胆胜胞胖脉勉狭狮独狡狱狠贸怨
|
||||
急饶蚀饺饼弯将奖哀亭亮度迹庭疮疯疫疤姿亲音帝施闻阀阁差养美姜叛送
|
||||
类迷前首逆总炼炸炮烂剃洁洪洒浇浊洞测洗活派洽染济洋洲浑浓津恒恢恰
|
||||
恼恨举觉宣室宫宪突穿窃客冠语扁袄祖神祝误诱说诵垦退既屋昼费陡眉孩
|
||||
除险院娃姥姨姻娇怒架贺盈勇怠柔垒绑绒结绕骄绘给络骆绝绞统
|
Binary file not shown.
Loading…
Reference in New Issue