显示输入框字体;
<span style="white-space:pre"> </span> CCSize winSize =CCDirector::sharedDirector()->getWinSize(); CCTextFieldTTF* text = CCTextFieldTTF::textFieldWithPlaceHolder("hello","courier new",80); addChild(text); text->setPosition(ccp(winSize.width/2,winSize.height/2));
输入框:
CCEditBox* edit =CCEditBox::create(CCSize(200,40),CCScale9Sprite::create("scale9.png")); addChild(edit); edit->setPosition(ccp(winSize.width/2,winSize.height/2)); edit->setMaxLength(10); edit->setPlaceHolder("Please"); edit->setFont("couriernew",50); edit->setFontColor(ccc3(255,255,255));原文链接:https://www.f2er.com/cocos2dx/345225.html