void TextBMFont::copySpecialProperties(Widget *widget) { TextBMFont* labelBMFont = dynamic_cast<TextBMFont*>(widget); if (labelBMFont) { setFntFile(labelBMFont->_fntFileName); setString(labelBMFont->_stringValue); } }
void UILabelBMFont::copySpecialProperties(UIWidget *widget) { UILabelBMFont* labelBMFont = dynamic_cast<UILabelBMFont*>(widget); if (labelBMFont) { setFntFile(labelBMFont->m_strFntFileName.c_str()); setText(labelBMFont->m_strStringValue.c_str()); } }
// LabelBMFontBinaryFormat LabelBMFontBinaryFormat::LabelBMFontBinaryFormat() { auto s = Director::getInstance()->getWinSize(); auto bmFont = LabelBMFont::create(); bmFont->setFntFile("fonts/Roboto.bmf.fnt"); bmFont->setString("It is working!"); this->addChild(bmFont); bmFont->setPosition(Point(s.width/2,s.height/4*2)); }
BMFontInit::BMFontInit() { auto s = Director::getInstance()->getWinSize(); auto bmFont = LabelBMFont::create(); bmFont->setFntFile("fonts/helvetica-32.fnt"); bmFont->setString("It is working!"); this->addChild(bmFont); bmFont->setPosition(Point(s.width/2,s.height/4*2)); }
void TextBMFont::copySpecialProperties(Widget *widget) { TextBMFont* labelBMFont = dynamic_cast<TextBMFont*>(widget); if (labelBMFont) { setFntFile(labelBMFont->_fntFileName); setString(labelBMFont->_stringValue); _labelBMFontRenderer->setAdditionalKerning(labelBMFont->_labelBMFontRenderer->getAdditionalKerning()); //[CY ADD: fix clone¶ªÊ§¼ä¾àµÄbug] } }
Issue1343::Issue1343() { auto s = Director::getInstance()->getWinSize(); auto bmFont = LabelBMFont::create(); bmFont->setFntFile("fonts/font-issue1343.fnt"); bmFont->setString("ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz.,'"); this->addChild(bmFont); bmFont->setScale(0.3f); bmFont->setPosition(Point(s.width/2,s.height/4*2)); }