big0god
2016-04-19 13:45
这是HelloWorldLawyer.cpp #include"HelloWorldLawyer.h" HelloWorldLawyer * HelloWorldLawyer::create(){ HelloWorldLawyer * pRet = new HelloWorldLawyer(); if (pRet&&pRet->init()){ pRet->autorelease(); return pRet; } else{ CC_SAFE_DELETE(pRet); return NULL; } } bool HelloWorldLawyer::init(){ Size size = Director::getInstance()->getVisibleSize(); Label *label = Label::createWithTTF("Welcome To MyGame", "font/marks", 24); label->setPosition(Vec2(size.width / 2, size.height * 3 / 4)); return true; }
经过四个小时排查。。。。发现是因为工程里面没有fonts文件夹,自然找不到字体了,自己在Resources新建一个文件夹,然后下载字体进去,换成相应名字就可以啦
第二十行 font文件夹里里面没有marks
应该是fonts/Marker Felt.ttf
Cocos2d-x基础教程二-会动的时钟
19036 学习 · 44 问题
相似问题