I have a text field like this -
email = cocos2d::TextFieldTTF::textFieldWithPlaceHolder("hello",cocos2d::Size(0,0),TextHAlignment::LEFT, "fonts/A little sunshine.ttf", 48);
email->setPosition(Vec2(button4->getPositionX(),
button4->getPositionY()));
email->setColorSpaceHolder(Color3B(236,231,221));
email->setTextColor(Color4B(255,255,255,255));
email->setColor(Color3B(151,169,58));
email->setDelegate(this);
email->setVisible(false);
this->addChild(email);
auto touchListener = EventListenerTouchOneByOne::create();
touchListener->onTouchBegan = [](cocos2d::Touch* touch, cocos2d::Event * event)->bool {
try {
// Show the on screen keyboard
auto email = dynamic_cast<TextFieldTTF *>(event->getCurrentTarget());
email->attachWithIME();
return true;
}
catch(std::bad_cast & err){
return true;
}
};
_eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, email);
But its not showing the font mentioned, can anyone tell me why? I tried loading the font in labels and it loads fine, so there is no problem with font.
Or is there any other way to add textfield…
@slackmoehrle, can you please verify… 
