auto tf = TextFieldTTF::textFieldWithPlaceHolder("请输入本局昵称","宋体",30);
tf->setPosition(visibleSize / 2);
this->addChild(tf);
auto listener = EventListenerTouchOneByOne::create();
listener->onTouchBegan = [tf](Touch* touch,Event* event) {
if (tf->getBoundingBox().containsPoint(touch->getLocation())) {
tf->attachWithIME(); //调用输入法
}else{
tf->detachWithIME(); //关闭输入法
}
return false;
};
Director::getInstance()->getEventDispatcher()->
addEventListenerWithSceneGraPHPriority(listener,tf);
tf->getString(); //获取内容