您的位置:首页 > 移动开发 > Cocos引擎

cocos2d-x默认字体修改之CCLabelTTF, 修改为微软雅黑

2014-12-15 13:43 2001 查看
bool CCLabelTTF::initWithString(const char *string, const char *fontName, float fontSize,
const cocos2d::CCSize &dimensions, CCTextAlignment hAlignment,
CCVerticalTextAlignment vAlignment)
{
if (CCSprite::init())
{
// shader program
this->setShaderProgram(CCShaderCache::sharedShaderCache()->programForKey(SHADER_PROGRAM));

m_tDimensions = CCSizeMake(dimensions.width, dimensions.height);
m_hAlignment  = hAlignment;
m_vAlignment  = vAlignment;
//m_pFontName   = new std::string(fontName);
m_pFontName   = new std::string("Microsoft Yahei");
m_fFontSize   = fontSize;

this->setString(string);

return true;
}

return false;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: