cocos2d-x 标签加黑边和阴影

来源:互联网 发布:淘宝助理申通模板 编辑:程序博客网 时间:2024/05/23 18:34

出自:cocos2d-x testCpp

CCSize s = CCDirector::sharedDirector()->getWinSize();    CCSize shadowOffset(5.0, 5.0);    // font definition    ccFontDefinition shadowTextDef;    shadowTextDef.m_fontSize = 48;    shadowTextDef.m_fontName = std::string(strFONT_BOLD_HELVETICA);    // shadow    shadowTextDef.m_shadow.m_shadowEnabled = false;    shadowTextDef.m_shadow.m_shadowOffset  = shadowOffset;    shadowTextDef.m_shadow.m_shadowOpacity = 1.0f;    shadowTextDef.m_shadow.m_shadowBlur    = 0.5f;    // stroke    shadowTextDef.m_stroke.m_strokeEnabled = true;    shadowTextDef.m_stroke.m_strokeColor   = ccBLACK;    shadowTextDef.m_stroke.m_strokeSize    = 1.f;    // font fill color    shadowTextDef.m_fontFillColor   = ccRED;    // label    CCLabelTTF* fontShadow = CCLabelTTF::createWithFontDefinition("Shadow Only Red Text", shadowTextDef);    fontShadow->setPosition(ccp(s.width * 0.5f, s.height * 0.5f));    // add label to the scene    this->addChild(fontShadow);

0 0
原创粉丝点击